Product Library API
POST
Create a new category
{{baseUrl}}/organizations/:organizationUuid/categories/v2
QUERY PARAMS
organizationUuid
BODY json
{
"categories": [
{
"name": "",
"uuid": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationUuid/categories/v2");
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 \"categories\": [\n {\n \"name\": \"\",\n \"uuid\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/organizations/:organizationUuid/categories/v2" {:content-type :json
:form-params {:categories [{:name ""
:uuid ""}]}})
require "http/client"
url = "{{baseUrl}}/organizations/:organizationUuid/categories/v2"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"categories\": [\n {\n \"name\": \"\",\n \"uuid\": \"\"\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}}/organizations/:organizationUuid/categories/v2"),
Content = new StringContent("{\n \"categories\": [\n {\n \"name\": \"\",\n \"uuid\": \"\"\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}}/organizations/:organizationUuid/categories/v2");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"categories\": [\n {\n \"name\": \"\",\n \"uuid\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationUuid/categories/v2"
payload := strings.NewReader("{\n \"categories\": [\n {\n \"name\": \"\",\n \"uuid\": \"\"\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/organizations/:organizationUuid/categories/v2 HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 72
{
"categories": [
{
"name": "",
"uuid": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/organizations/:organizationUuid/categories/v2")
.setHeader("content-type", "application/json")
.setBody("{\n \"categories\": [\n {\n \"name\": \"\",\n \"uuid\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationUuid/categories/v2"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"categories\": [\n {\n \"name\": \"\",\n \"uuid\": \"\"\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 \"categories\": [\n {\n \"name\": \"\",\n \"uuid\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/organizations/:organizationUuid/categories/v2")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/organizations/:organizationUuid/categories/v2")
.header("content-type", "application/json")
.body("{\n \"categories\": [\n {\n \"name\": \"\",\n \"uuid\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
categories: [
{
name: '',
uuid: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/organizations/:organizationUuid/categories/v2');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationUuid/categories/v2',
headers: {'content-type': 'application/json'},
data: {categories: [{name: '', uuid: ''}]}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationUuid/categories/v2';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"categories":[{"name":"","uuid":""}]}'
};
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}}/organizations/:organizationUuid/categories/v2',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "categories": [\n {\n "name": "",\n "uuid": ""\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 \"categories\": [\n {\n \"name\": \"\",\n \"uuid\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationUuid/categories/v2")
.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/organizations/:organizationUuid/categories/v2',
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({categories: [{name: '', uuid: ''}]}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationUuid/categories/v2',
headers: {'content-type': 'application/json'},
body: {categories: [{name: '', uuid: ''}]},
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}}/organizations/:organizationUuid/categories/v2');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
categories: [
{
name: '',
uuid: ''
}
]
});
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}}/organizations/:organizationUuid/categories/v2',
headers: {'content-type': 'application/json'},
data: {categories: [{name: '', uuid: ''}]}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationUuid/categories/v2';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"categories":[{"name":"","uuid":""}]}'
};
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 = @{ @"categories": @[ @{ @"name": @"", @"uuid": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/organizations/:organizationUuid/categories/v2"]
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}}/organizations/:organizationUuid/categories/v2" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"categories\": [\n {\n \"name\": \"\",\n \"uuid\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationUuid/categories/v2",
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([
'categories' => [
[
'name' => '',
'uuid' => ''
]
]
]),
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}}/organizations/:organizationUuid/categories/v2', [
'body' => '{
"categories": [
{
"name": "",
"uuid": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationUuid/categories/v2');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'categories' => [
[
'name' => '',
'uuid' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'categories' => [
[
'name' => '',
'uuid' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/organizations/:organizationUuid/categories/v2');
$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}}/organizations/:organizationUuid/categories/v2' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"categories": [
{
"name": "",
"uuid": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationUuid/categories/v2' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"categories": [
{
"name": "",
"uuid": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"categories\": [\n {\n \"name\": \"\",\n \"uuid\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/organizations/:organizationUuid/categories/v2", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationUuid/categories/v2"
payload = { "categories": [
{
"name": "",
"uuid": ""
}
] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationUuid/categories/v2"
payload <- "{\n \"categories\": [\n {\n \"name\": \"\",\n \"uuid\": \"\"\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}}/organizations/:organizationUuid/categories/v2")
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 \"categories\": [\n {\n \"name\": \"\",\n \"uuid\": \"\"\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/organizations/:organizationUuid/categories/v2') do |req|
req.body = "{\n \"categories\": [\n {\n \"name\": \"\",\n \"uuid\": \"\"\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}}/organizations/:organizationUuid/categories/v2";
let payload = json!({"categories": (
json!({
"name": "",
"uuid": ""
})
)});
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}}/organizations/:organizationUuid/categories/v2 \
--header 'content-type: application/json' \
--data '{
"categories": [
{
"name": "",
"uuid": ""
}
]
}'
echo '{
"categories": [
{
"name": "",
"uuid": ""
}
]
}' | \
http POST {{baseUrl}}/organizations/:organizationUuid/categories/v2 \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "categories": [\n {\n "name": "",\n "uuid": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/organizations/:organizationUuid/categories/v2
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["categories": [
[
"name": "",
"uuid": ""
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationUuid/categories/v2")! 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
Delete a category
{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid
QUERY PARAMS
organizationUuid
categoryUuid
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid"
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}}/organizations/:organizationUuid/categories/v2/:categoryUuid"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid"
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/organizations/:organizationUuid/categories/v2/:categoryUuid HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid"))
.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}}/organizations/:organizationUuid/categories/v2/:categoryUuid")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid")
.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}}/organizations/:organizationUuid/categories/v2/:categoryUuid');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid';
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}}/organizations/:organizationUuid/categories/v2/:categoryUuid',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationUuid/categories/v2/:categoryUuid',
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}}/organizations/:organizationUuid/categories/v2/:categoryUuid'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid');
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}}/organizations/:organizationUuid/categories/v2/:categoryUuid'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid';
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}}/organizations/:organizationUuid/categories/v2/:categoryUuid"]
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}}/organizations/:organizationUuid/categories/v2/:categoryUuid" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid",
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}}/organizations/:organizationUuid/categories/v2/:categoryUuid');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/organizations/:organizationUuid/categories/v2/:categoryUuid")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid")
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/organizations/:organizationUuid/categories/v2/:categoryUuid') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid";
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}}/organizations/:organizationUuid/categories/v2/:categoryUuid
http DELETE {{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid")! 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()
PATCH
Rename a category
{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid
QUERY PARAMS
organizationUuid
categoryUuid
BODY json
{
"name": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid");
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 \"name\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid" {:content-type :json
:form-params {:name ""}})
require "http/client"
url = "{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\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}}/organizations/:organizationUuid/categories/v2/:categoryUuid"),
Content = new StringContent("{\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}}/organizations/:organizationUuid/categories/v2/:categoryUuid");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"name\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid"
payload := strings.NewReader("{\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/organizations/:organizationUuid/categories/v2/:categoryUuid HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 16
{
"name": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid")
.setHeader("content-type", "application/json")
.setBody("{\n \"name\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\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 \"name\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid")
.header("content-type", "application/json")
.body("{\n \"name\": \"\"\n}")
.asString();
const data = JSON.stringify({
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}}/organizations/:organizationUuid/categories/v2/:categoryUuid');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid',
headers: {'content-type': 'application/json'},
data: {name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"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}}/organizations/:organizationUuid/categories/v2/:categoryUuid',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\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 \"name\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid")
.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/organizations/:organizationUuid/categories/v2/:categoryUuid',
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({name: ''}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid',
headers: {'content-type': 'application/json'},
body: {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}}/organizations/:organizationUuid/categories/v2/:categoryUuid');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
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}}/organizations/:organizationUuid/categories/v2/:categoryUuid',
headers: {'content-type': 'application/json'},
data: {name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"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 = @{ @"name": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid"]
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}}/organizations/:organizationUuid/categories/v2/:categoryUuid" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"name\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid",
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([
'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}}/organizations/:organizationUuid/categories/v2/:categoryUuid', [
'body' => '{
"name": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'name' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'name' => ''
]));
$request->setRequestUrl('{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid');
$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}}/organizations/:organizationUuid/categories/v2/:categoryUuid' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"name": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"name": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"name\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/organizations/:organizationUuid/categories/v2/:categoryUuid", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid"
payload = { "name": "" }
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid"
payload <- "{\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}}/organizations/:organizationUuid/categories/v2/:categoryUuid")
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 \"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/organizations/:organizationUuid/categories/v2/:categoryUuid') do |req|
req.body = "{\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}}/organizations/:organizationUuid/categories/v2/:categoryUuid";
let payload = json!({"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}}/organizations/:organizationUuid/categories/v2/:categoryUuid \
--header 'content-type: application/json' \
--data '{
"name": ""
}'
echo '{
"name": ""
}' | \
http PATCH {{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "name": ""\n}' \
--output-document \
- {{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["name": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationUuid/categories/v2/:categoryUuid")! 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
Retrieve all categories
{{baseUrl}}/organizations/:organizationUuid/categories/v2
QUERY PARAMS
organizationUuid
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationUuid/categories/v2");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations/:organizationUuid/categories/v2")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationUuid/categories/v2"
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}}/organizations/:organizationUuid/categories/v2"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationUuid/categories/v2");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationUuid/categories/v2"
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/organizations/:organizationUuid/categories/v2 HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations/:organizationUuid/categories/v2")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationUuid/categories/v2"))
.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}}/organizations/:organizationUuid/categories/v2")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations/:organizationUuid/categories/v2")
.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}}/organizations/:organizationUuid/categories/v2');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/organizations/:organizationUuid/categories/v2'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationUuid/categories/v2';
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}}/organizations/:organizationUuid/categories/v2',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationUuid/categories/v2")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationUuid/categories/v2',
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}}/organizations/:organizationUuid/categories/v2'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/organizations/:organizationUuid/categories/v2');
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}}/organizations/:organizationUuid/categories/v2'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationUuid/categories/v2';
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}}/organizations/:organizationUuid/categories/v2"]
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}}/organizations/:organizationUuid/categories/v2" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationUuid/categories/v2",
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}}/organizations/:organizationUuid/categories/v2');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationUuid/categories/v2');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationUuid/categories/v2');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationUuid/categories/v2' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationUuid/categories/v2' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations/:organizationUuid/categories/v2")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationUuid/categories/v2"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationUuid/categories/v2"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationUuid/categories/v2")
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/organizations/:organizationUuid/categories/v2') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationUuid/categories/v2";
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}}/organizations/:organizationUuid/categories/v2
http GET {{baseUrl}}/organizations/:organizationUuid/categories/v2
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations/:organizationUuid/categories/v2
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationUuid/categories/v2")! 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
Create a discount
{{baseUrl}}/organizations/:organizationUuid/discounts
QUERY PARAMS
organizationUuid
BODY json
{
"amount": {
"amount": 0,
"currencyId": ""
},
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"name": "",
"percentage": "",
"uuid": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationUuid/discounts");
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 \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"name\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/organizations/:organizationUuid/discounts" {:content-type :json
:form-params {:amount {:amount 0
:currencyId ""}
:description ""
:externalReference ""
:imageLookupKeys []
:name ""
:percentage ""
:uuid ""}})
require "http/client"
url = "{{baseUrl}}/organizations/:organizationUuid/discounts"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"amount\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"name\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\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}}/organizations/:organizationUuid/discounts"),
Content = new StringContent("{\n \"amount\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"name\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\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}}/organizations/:organizationUuid/discounts");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"amount\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"name\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationUuid/discounts"
payload := strings.NewReader("{\n \"amount\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"name\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\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/organizations/:organizationUuid/discounts HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 180
{
"amount": {
"amount": 0,
"currencyId": ""
},
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"name": "",
"percentage": "",
"uuid": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/organizations/:organizationUuid/discounts")
.setHeader("content-type", "application/json")
.setBody("{\n \"amount\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"name\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationUuid/discounts"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"amount\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"name\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\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 \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"name\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/organizations/:organizationUuid/discounts")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/organizations/:organizationUuid/discounts")
.header("content-type", "application/json")
.body("{\n \"amount\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"name\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\n}")
.asString();
const data = JSON.stringify({
amount: {
amount: 0,
currencyId: ''
},
description: '',
externalReference: '',
imageLookupKeys: [],
name: '',
percentage: '',
uuid: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/organizations/:organizationUuid/discounts');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationUuid/discounts',
headers: {'content-type': 'application/json'},
data: {
amount: {amount: 0, currencyId: ''},
description: '',
externalReference: '',
imageLookupKeys: [],
name: '',
percentage: '',
uuid: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationUuid/discounts';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"amount":{"amount":0,"currencyId":""},"description":"","externalReference":"","imageLookupKeys":[],"name":"","percentage":"","uuid":""}'
};
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}}/organizations/:organizationUuid/discounts',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "amount": {\n "amount": 0,\n "currencyId": ""\n },\n "description": "",\n "externalReference": "",\n "imageLookupKeys": [],\n "name": "",\n "percentage": "",\n "uuid": ""\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 \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"name\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationUuid/discounts")
.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/organizations/:organizationUuid/discounts',
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: {amount: 0, currencyId: ''},
description: '',
externalReference: '',
imageLookupKeys: [],
name: '',
percentage: '',
uuid: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationUuid/discounts',
headers: {'content-type': 'application/json'},
body: {
amount: {amount: 0, currencyId: ''},
description: '',
externalReference: '',
imageLookupKeys: [],
name: '',
percentage: '',
uuid: ''
},
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}}/organizations/:organizationUuid/discounts');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
amount: {
amount: 0,
currencyId: ''
},
description: '',
externalReference: '',
imageLookupKeys: [],
name: '',
percentage: '',
uuid: ''
});
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}}/organizations/:organizationUuid/discounts',
headers: {'content-type': 'application/json'},
data: {
amount: {amount: 0, currencyId: ''},
description: '',
externalReference: '',
imageLookupKeys: [],
name: '',
percentage: '',
uuid: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationUuid/discounts';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"amount":{"amount":0,"currencyId":""},"description":"","externalReference":"","imageLookupKeys":[],"name":"","percentage":"","uuid":""}'
};
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": @{ @"amount": @0, @"currencyId": @"" },
@"description": @"",
@"externalReference": @"",
@"imageLookupKeys": @[ ],
@"name": @"",
@"percentage": @"",
@"uuid": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/organizations/:organizationUuid/discounts"]
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}}/organizations/:organizationUuid/discounts" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"amount\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"name\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationUuid/discounts",
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' => [
'amount' => 0,
'currencyId' => ''
],
'description' => '',
'externalReference' => '',
'imageLookupKeys' => [
],
'name' => '',
'percentage' => '',
'uuid' => ''
]),
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}}/organizations/:organizationUuid/discounts', [
'body' => '{
"amount": {
"amount": 0,
"currencyId": ""
},
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"name": "",
"percentage": "",
"uuid": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationUuid/discounts');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'amount' => [
'amount' => 0,
'currencyId' => ''
],
'description' => '',
'externalReference' => '',
'imageLookupKeys' => [
],
'name' => '',
'percentage' => '',
'uuid' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'amount' => [
'amount' => 0,
'currencyId' => ''
],
'description' => '',
'externalReference' => '',
'imageLookupKeys' => [
],
'name' => '',
'percentage' => '',
'uuid' => ''
]));
$request->setRequestUrl('{{baseUrl}}/organizations/:organizationUuid/discounts');
$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}}/organizations/:organizationUuid/discounts' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"amount": {
"amount": 0,
"currencyId": ""
},
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"name": "",
"percentage": "",
"uuid": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationUuid/discounts' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"amount": {
"amount": 0,
"currencyId": ""
},
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"name": "",
"percentage": "",
"uuid": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"amount\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"name\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/organizations/:organizationUuid/discounts", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationUuid/discounts"
payload = {
"amount": {
"amount": 0,
"currencyId": ""
},
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"name": "",
"percentage": "",
"uuid": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationUuid/discounts"
payload <- "{\n \"amount\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"name\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\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}}/organizations/:organizationUuid/discounts")
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 \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"name\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\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/organizations/:organizationUuid/discounts') do |req|
req.body = "{\n \"amount\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"name\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationUuid/discounts";
let payload = json!({
"amount": json!({
"amount": 0,
"currencyId": ""
}),
"description": "",
"externalReference": "",
"imageLookupKeys": (),
"name": "",
"percentage": "",
"uuid": ""
});
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}}/organizations/:organizationUuid/discounts \
--header 'content-type: application/json' \
--data '{
"amount": {
"amount": 0,
"currencyId": ""
},
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"name": "",
"percentage": "",
"uuid": ""
}'
echo '{
"amount": {
"amount": 0,
"currencyId": ""
},
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"name": "",
"percentage": "",
"uuid": ""
}' | \
http POST {{baseUrl}}/organizations/:organizationUuid/discounts \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "amount": {\n "amount": 0,\n "currencyId": ""\n },\n "description": "",\n "externalReference": "",\n "imageLookupKeys": [],\n "name": "",\n "percentage": "",\n "uuid": ""\n}' \
--output-document \
- {{baseUrl}}/organizations/:organizationUuid/discounts
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"amount": [
"amount": 0,
"currencyId": ""
],
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"name": "",
"percentage": "",
"uuid": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationUuid/discounts")! 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
Delete a single discount
{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid
QUERY PARAMS
organizationUuid
discountUuid
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid"
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}}/organizations/:organizationUuid/discounts/:discountUuid"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid"
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/organizations/:organizationUuid/discounts/:discountUuid HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid"))
.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}}/organizations/:organizationUuid/discounts/:discountUuid")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid")
.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}}/organizations/:organizationUuid/discounts/:discountUuid');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid';
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}}/organizations/:organizationUuid/discounts/:discountUuid',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationUuid/discounts/:discountUuid',
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}}/organizations/:organizationUuid/discounts/:discountUuid'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid');
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}}/organizations/:organizationUuid/discounts/:discountUuid'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid';
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}}/organizations/:organizationUuid/discounts/:discountUuid"]
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}}/organizations/:organizationUuid/discounts/:discountUuid" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid",
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}}/organizations/:organizationUuid/discounts/:discountUuid');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/organizations/:organizationUuid/discounts/:discountUuid")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid")
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/organizations/:organizationUuid/discounts/:discountUuid') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid";
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}}/organizations/:organizationUuid/discounts/:discountUuid
http DELETE {{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid")! 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
Retrieve a single discount
{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid
QUERY PARAMS
organizationUuid
discountUuid
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid"
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}}/organizations/:organizationUuid/discounts/:discountUuid"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid"
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/organizations/:organizationUuid/discounts/:discountUuid HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid"))
.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}}/organizations/:organizationUuid/discounts/:discountUuid")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid")
.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}}/organizations/:organizationUuid/discounts/:discountUuid');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid';
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}}/organizations/:organizationUuid/discounts/:discountUuid',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationUuid/discounts/:discountUuid',
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}}/organizations/:organizationUuid/discounts/:discountUuid'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid');
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}}/organizations/:organizationUuid/discounts/:discountUuid'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid';
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}}/organizations/:organizationUuid/discounts/:discountUuid"]
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}}/organizations/:organizationUuid/discounts/:discountUuid" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid",
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}}/organizations/:organizationUuid/discounts/:discountUuid');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations/:organizationUuid/discounts/:discountUuid")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid")
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/organizations/:organizationUuid/discounts/:discountUuid') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid";
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}}/organizations/:organizationUuid/discounts/:discountUuid
http GET {{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid")! 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
Retrieve all discounts
{{baseUrl}}/organizations/:organizationUuid/discounts
QUERY PARAMS
organizationUuid
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationUuid/discounts");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations/:organizationUuid/discounts")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationUuid/discounts"
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}}/organizations/:organizationUuid/discounts"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationUuid/discounts");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationUuid/discounts"
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/organizations/:organizationUuid/discounts HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations/:organizationUuid/discounts")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationUuid/discounts"))
.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}}/organizations/:organizationUuid/discounts")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations/:organizationUuid/discounts")
.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}}/organizations/:organizationUuid/discounts');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/organizations/:organizationUuid/discounts'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationUuid/discounts';
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}}/organizations/:organizationUuid/discounts',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationUuid/discounts")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationUuid/discounts',
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}}/organizations/:organizationUuid/discounts'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/organizations/:organizationUuid/discounts');
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}}/organizations/:organizationUuid/discounts'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationUuid/discounts';
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}}/organizations/:organizationUuid/discounts"]
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}}/organizations/:organizationUuid/discounts" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationUuid/discounts",
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}}/organizations/:organizationUuid/discounts');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationUuid/discounts');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationUuid/discounts');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationUuid/discounts' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationUuid/discounts' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations/:organizationUuid/discounts")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationUuid/discounts"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationUuid/discounts"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationUuid/discounts")
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/organizations/:organizationUuid/discounts') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationUuid/discounts";
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}}/organizations/:organizationUuid/discounts
http GET {{baseUrl}}/organizations/:organizationUuid/discounts
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations/:organizationUuid/discounts
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationUuid/discounts")! 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
Update a single discount
{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid
QUERY PARAMS
organizationUuid
discountUuid
BODY json
{
"amount": {
"amount": 0,
"currencyId": ""
},
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"name": "",
"percentage": "",
"uuid": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid");
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 \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"name\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid" {:content-type :json
:form-params {:amount {:amount 0
:currencyId ""}
:description ""
:externalReference ""
:imageLookupKeys []
:name ""
:percentage ""
:uuid ""}})
require "http/client"
url = "{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"amount\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"name\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\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}}/organizations/:organizationUuid/discounts/:discountUuid"),
Content = new StringContent("{\n \"amount\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"name\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\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}}/organizations/:organizationUuid/discounts/:discountUuid");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"amount\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"name\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid"
payload := strings.NewReader("{\n \"amount\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"name\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\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/organizations/:organizationUuid/discounts/:discountUuid HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 180
{
"amount": {
"amount": 0,
"currencyId": ""
},
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"name": "",
"percentage": "",
"uuid": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid")
.setHeader("content-type", "application/json")
.setBody("{\n \"amount\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"name\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"amount\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"name\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\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 \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"name\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid")
.header("content-type", "application/json")
.body("{\n \"amount\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"name\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\n}")
.asString();
const data = JSON.stringify({
amount: {
amount: 0,
currencyId: ''
},
description: '',
externalReference: '',
imageLookupKeys: [],
name: '',
percentage: '',
uuid: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid',
headers: {'content-type': 'application/json'},
data: {
amount: {amount: 0, currencyId: ''},
description: '',
externalReference: '',
imageLookupKeys: [],
name: '',
percentage: '',
uuid: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"amount":{"amount":0,"currencyId":""},"description":"","externalReference":"","imageLookupKeys":[],"name":"","percentage":"","uuid":""}'
};
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}}/organizations/:organizationUuid/discounts/:discountUuid',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "amount": {\n "amount": 0,\n "currencyId": ""\n },\n "description": "",\n "externalReference": "",\n "imageLookupKeys": [],\n "name": "",\n "percentage": "",\n "uuid": ""\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 \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"name\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid")
.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/organizations/:organizationUuid/discounts/:discountUuid',
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: {amount: 0, currencyId: ''},
description: '',
externalReference: '',
imageLookupKeys: [],
name: '',
percentage: '',
uuid: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid',
headers: {'content-type': 'application/json'},
body: {
amount: {amount: 0, currencyId: ''},
description: '',
externalReference: '',
imageLookupKeys: [],
name: '',
percentage: '',
uuid: ''
},
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}}/organizations/:organizationUuid/discounts/:discountUuid');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
amount: {
amount: 0,
currencyId: ''
},
description: '',
externalReference: '',
imageLookupKeys: [],
name: '',
percentage: '',
uuid: ''
});
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}}/organizations/:organizationUuid/discounts/:discountUuid',
headers: {'content-type': 'application/json'},
data: {
amount: {amount: 0, currencyId: ''},
description: '',
externalReference: '',
imageLookupKeys: [],
name: '',
percentage: '',
uuid: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"amount":{"amount":0,"currencyId":""},"description":"","externalReference":"","imageLookupKeys":[],"name":"","percentage":"","uuid":""}'
};
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": @{ @"amount": @0, @"currencyId": @"" },
@"description": @"",
@"externalReference": @"",
@"imageLookupKeys": @[ ],
@"name": @"",
@"percentage": @"",
@"uuid": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid"]
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}}/organizations/:organizationUuid/discounts/:discountUuid" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"amount\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"name\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid",
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([
'amount' => [
'amount' => 0,
'currencyId' => ''
],
'description' => '',
'externalReference' => '',
'imageLookupKeys' => [
],
'name' => '',
'percentage' => '',
'uuid' => ''
]),
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}}/organizations/:organizationUuid/discounts/:discountUuid', [
'body' => '{
"amount": {
"amount": 0,
"currencyId": ""
},
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"name": "",
"percentage": "",
"uuid": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'amount' => [
'amount' => 0,
'currencyId' => ''
],
'description' => '',
'externalReference' => '',
'imageLookupKeys' => [
],
'name' => '',
'percentage' => '',
'uuid' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'amount' => [
'amount' => 0,
'currencyId' => ''
],
'description' => '',
'externalReference' => '',
'imageLookupKeys' => [
],
'name' => '',
'percentage' => '',
'uuid' => ''
]));
$request->setRequestUrl('{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid');
$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}}/organizations/:organizationUuid/discounts/:discountUuid' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"amount": {
"amount": 0,
"currencyId": ""
},
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"name": "",
"percentage": "",
"uuid": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"amount": {
"amount": 0,
"currencyId": ""
},
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"name": "",
"percentage": "",
"uuid": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"amount\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"name\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/organizations/:organizationUuid/discounts/:discountUuid", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid"
payload = {
"amount": {
"amount": 0,
"currencyId": ""
},
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"name": "",
"percentage": "",
"uuid": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid"
payload <- "{\n \"amount\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"name\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\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}}/organizations/:organizationUuid/discounts/:discountUuid")
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 \"amount\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"name\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\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/organizations/:organizationUuid/discounts/:discountUuid') do |req|
req.body = "{\n \"amount\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"name\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\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}}/organizations/:organizationUuid/discounts/:discountUuid";
let payload = json!({
"amount": json!({
"amount": 0,
"currencyId": ""
}),
"description": "",
"externalReference": "",
"imageLookupKeys": (),
"name": "",
"percentage": "",
"uuid": ""
});
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}}/organizations/:organizationUuid/discounts/:discountUuid \
--header 'content-type: application/json' \
--data '{
"amount": {
"amount": 0,
"currencyId": ""
},
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"name": "",
"percentage": "",
"uuid": ""
}'
echo '{
"amount": {
"amount": 0,
"currencyId": ""
},
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"name": "",
"percentage": "",
"uuid": ""
}' | \
http PUT {{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "amount": {\n "amount": 0,\n "currencyId": ""\n },\n "description": "",\n "externalReference": "",\n "imageLookupKeys": [],\n "name": "",\n "percentage": "",\n "uuid": ""\n}' \
--output-document \
- {{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"amount": [
"amount": 0,
"currencyId": ""
],
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"name": "",
"percentage": "",
"uuid": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationUuid/discounts/:discountUuid")! 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
Retrieve all library item images
{{baseUrl}}/organizations/:organizationUuid/images
QUERY PARAMS
organizationUuid
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationUuid/images");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations/:organizationUuid/images")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationUuid/images"
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}}/organizations/:organizationUuid/images"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationUuid/images");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationUuid/images"
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/organizations/:organizationUuid/images HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations/:organizationUuid/images")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationUuid/images"))
.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}}/organizations/:organizationUuid/images")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations/:organizationUuid/images")
.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}}/organizations/:organizationUuid/images');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/organizations/:organizationUuid/images'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationUuid/images';
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}}/organizations/:organizationUuid/images',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationUuid/images")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationUuid/images',
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}}/organizations/:organizationUuid/images'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/organizations/:organizationUuid/images');
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}}/organizations/:organizationUuid/images'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationUuid/images';
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}}/organizations/:organizationUuid/images"]
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}}/organizations/:organizationUuid/images" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationUuid/images",
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}}/organizations/:organizationUuid/images');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationUuid/images');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationUuid/images');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationUuid/images' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationUuid/images' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations/:organizationUuid/images")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationUuid/images"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationUuid/images"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationUuid/images")
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/organizations/:organizationUuid/images') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationUuid/images";
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}}/organizations/:organizationUuid/images
http GET {{baseUrl}}/organizations/:organizationUuid/images
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations/:organizationUuid/images
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationUuid/images")! 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
Get status for an import
{{baseUrl}}/organizations/:organizationUuid/import/status/:importUuid
QUERY PARAMS
organizationUuid
importUuid
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationUuid/import/status/:importUuid");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations/:organizationUuid/import/status/:importUuid")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationUuid/import/status/:importUuid"
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}}/organizations/:organizationUuid/import/status/:importUuid"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationUuid/import/status/:importUuid");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationUuid/import/status/:importUuid"
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/organizations/:organizationUuid/import/status/:importUuid HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations/:organizationUuid/import/status/:importUuid")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationUuid/import/status/:importUuid"))
.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}}/organizations/:organizationUuid/import/status/:importUuid")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations/:organizationUuid/import/status/:importUuid")
.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}}/organizations/:organizationUuid/import/status/:importUuid');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/organizations/:organizationUuid/import/status/:importUuid'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationUuid/import/status/:importUuid';
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}}/organizations/:organizationUuid/import/status/:importUuid',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationUuid/import/status/:importUuid")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationUuid/import/status/:importUuid',
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}}/organizations/:organizationUuid/import/status/:importUuid'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/organizations/:organizationUuid/import/status/:importUuid');
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}}/organizations/:organizationUuid/import/status/:importUuid'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationUuid/import/status/:importUuid';
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}}/organizations/:organizationUuid/import/status/:importUuid"]
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}}/organizations/:organizationUuid/import/status/:importUuid" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationUuid/import/status/:importUuid",
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}}/organizations/:organizationUuid/import/status/:importUuid');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationUuid/import/status/:importUuid');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationUuid/import/status/:importUuid');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationUuid/import/status/:importUuid' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationUuid/import/status/:importUuid' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations/:organizationUuid/import/status/:importUuid")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationUuid/import/status/:importUuid"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationUuid/import/status/:importUuid"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationUuid/import/status/:importUuid")
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/organizations/:organizationUuid/import/status/:importUuid') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationUuid/import/status/:importUuid";
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}}/organizations/:organizationUuid/import/status/:importUuid
http GET {{baseUrl}}/organizations/:organizationUuid/import/status/:importUuid
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations/:organizationUuid/import/status/:importUuid
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationUuid/import/status/:importUuid")! 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
Get status for latest import
{{baseUrl}}/organizations/:organizationUuid/import/status
QUERY PARAMS
organizationUuid
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationUuid/import/status");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations/:organizationUuid/import/status")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationUuid/import/status"
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}}/organizations/:organizationUuid/import/status"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationUuid/import/status");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationUuid/import/status"
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/organizations/:organizationUuid/import/status HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations/:organizationUuid/import/status")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationUuid/import/status"))
.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}}/organizations/:organizationUuid/import/status")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations/:organizationUuid/import/status")
.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}}/organizations/:organizationUuid/import/status');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/organizations/:organizationUuid/import/status'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationUuid/import/status';
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}}/organizations/:organizationUuid/import/status',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationUuid/import/status")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationUuid/import/status',
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}}/organizations/:organizationUuid/import/status'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/organizations/:organizationUuid/import/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: 'GET',
url: '{{baseUrl}}/organizations/:organizationUuid/import/status'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationUuid/import/status';
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}}/organizations/:organizationUuid/import/status"]
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}}/organizations/:organizationUuid/import/status" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationUuid/import/status",
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}}/organizations/:organizationUuid/import/status');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationUuid/import/status');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationUuid/import/status');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationUuid/import/status' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationUuid/import/status' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations/:organizationUuid/import/status")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationUuid/import/status"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationUuid/import/status"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationUuid/import/status")
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/organizations/:organizationUuid/import/status') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationUuid/import/status";
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}}/organizations/:organizationUuid/import/status
http GET {{baseUrl}}/organizations/:organizationUuid/import/status
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations/:organizationUuid/import/status
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationUuid/import/status")! 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
Import library items
{{baseUrl}}/organizations/:organizationUuid/import/v2
QUERY PARAMS
organizationUuid
BODY json
{
"products": [
{
"categories": [],
"category": {
"name": "",
"uuid": ""
},
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"metadata": {
"inPos": false,
"source": {
"external": false,
"name": ""
}
},
"name": "",
"online": {
"description": "",
"presentation": {
"additionalImageUrls": [],
"displayImageUrl": "",
"mediaUrls": []
},
"seo": {
"metaDescription": "",
"slug": "",
"title": ""
},
"shipping": {
"shippingPricingModel": "",
"weight": {
"unit": "",
"weight": ""
},
"weightInGrams": 0
},
"status": "",
"title": ""
},
"presentation": {
"backgroundColor": "",
"imageUrl": "",
"textColor": ""
},
"taxCode": "",
"taxExempt": false,
"taxRates": [],
"unitName": "",
"uuid": "",
"variantOptionDefinitions": {
"definitions": [
{
"name": "",
"properties": [
{
"imageUrl": "",
"value": ""
}
]
}
]
},
"variants": [
{
"barcode": "",
"costPrice": {
"amount": 0,
"currencyId": ""
},
"description": "",
"name": "",
"options": [
{
"name": "",
"value": ""
}
],
"presentation": {},
"price": {},
"sku": "",
"uuid": "",
"vatPercentage": ""
}
],
"vatPercentage": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationUuid/import/v2");
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 \"products\": [\n {\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/organizations/:organizationUuid/import/v2" {:content-type :json
:form-params {:products [{:categories []
:category {:name ""
:uuid ""}
:description ""
:externalReference ""
:imageLookupKeys []
:metadata {:inPos false
:source {:external false
:name ""}}
:name ""
:online {:description ""
:presentation {:additionalImageUrls []
:displayImageUrl ""
:mediaUrls []}
:seo {:metaDescription ""
:slug ""
:title ""}
:shipping {:shippingPricingModel ""
:weight {:unit ""
:weight ""}
:weightInGrams 0}
:status ""
:title ""}
:presentation {:backgroundColor ""
:imageUrl ""
:textColor ""}
:taxCode ""
:taxExempt false
:taxRates []
:unitName ""
:uuid ""
:variantOptionDefinitions {:definitions [{:name ""
:properties [{:imageUrl ""
:value ""}]}]}
:variants [{:barcode ""
:costPrice {:amount 0
:currencyId ""}
:description ""
:name ""
:options [{:name ""
:value ""}]
:presentation {}
:price {}
:sku ""
:uuid ""
:vatPercentage ""}]
:vatPercentage ""}]}})
require "http/client"
url = "{{baseUrl}}/organizations/:organizationUuid/import/v2"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"products\": [\n {\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\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}}/organizations/:organizationUuid/import/v2"),
Content = new StringContent("{\n \"products\": [\n {\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\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}}/organizations/:organizationUuid/import/v2");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"products\": [\n {\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationUuid/import/v2"
payload := strings.NewReader("{\n \"products\": [\n {\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\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/organizations/:organizationUuid/import/v2 HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1849
{
"products": [
{
"categories": [],
"category": {
"name": "",
"uuid": ""
},
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"metadata": {
"inPos": false,
"source": {
"external": false,
"name": ""
}
},
"name": "",
"online": {
"description": "",
"presentation": {
"additionalImageUrls": [],
"displayImageUrl": "",
"mediaUrls": []
},
"seo": {
"metaDescription": "",
"slug": "",
"title": ""
},
"shipping": {
"shippingPricingModel": "",
"weight": {
"unit": "",
"weight": ""
},
"weightInGrams": 0
},
"status": "",
"title": ""
},
"presentation": {
"backgroundColor": "",
"imageUrl": "",
"textColor": ""
},
"taxCode": "",
"taxExempt": false,
"taxRates": [],
"unitName": "",
"uuid": "",
"variantOptionDefinitions": {
"definitions": [
{
"name": "",
"properties": [
{
"imageUrl": "",
"value": ""
}
]
}
]
},
"variants": [
{
"barcode": "",
"costPrice": {
"amount": 0,
"currencyId": ""
},
"description": "",
"name": "",
"options": [
{
"name": "",
"value": ""
}
],
"presentation": {},
"price": {},
"sku": "",
"uuid": "",
"vatPercentage": ""
}
],
"vatPercentage": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/organizations/:organizationUuid/import/v2")
.setHeader("content-type", "application/json")
.setBody("{\n \"products\": [\n {\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationUuid/import/v2"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"products\": [\n {\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\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 \"products\": [\n {\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/organizations/:organizationUuid/import/v2")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/organizations/:organizationUuid/import/v2")
.header("content-type", "application/json")
.body("{\n \"products\": [\n {\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
products: [
{
categories: [],
category: {
name: '',
uuid: ''
},
description: '',
externalReference: '',
imageLookupKeys: [],
metadata: {
inPos: false,
source: {
external: false,
name: ''
}
},
name: '',
online: {
description: '',
presentation: {
additionalImageUrls: [],
displayImageUrl: '',
mediaUrls: []
},
seo: {
metaDescription: '',
slug: '',
title: ''
},
shipping: {
shippingPricingModel: '',
weight: {
unit: '',
weight: ''
},
weightInGrams: 0
},
status: '',
title: ''
},
presentation: {
backgroundColor: '',
imageUrl: '',
textColor: ''
},
taxCode: '',
taxExempt: false,
taxRates: [],
unitName: '',
uuid: '',
variantOptionDefinitions: {
definitions: [
{
name: '',
properties: [
{
imageUrl: '',
value: ''
}
]
}
]
},
variants: [
{
barcode: '',
costPrice: {
amount: 0,
currencyId: ''
},
description: '',
name: '',
options: [
{
name: '',
value: ''
}
],
presentation: {},
price: {},
sku: '',
uuid: '',
vatPercentage: ''
}
],
vatPercentage: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/organizations/:organizationUuid/import/v2');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationUuid/import/v2',
headers: {'content-type': 'application/json'},
data: {
products: [
{
categories: [],
category: {name: '', uuid: ''},
description: '',
externalReference: '',
imageLookupKeys: [],
metadata: {inPos: false, source: {external: false, name: ''}},
name: '',
online: {
description: '',
presentation: {additionalImageUrls: [], displayImageUrl: '', mediaUrls: []},
seo: {metaDescription: '', slug: '', title: ''},
shipping: {shippingPricingModel: '', weight: {unit: '', weight: ''}, weightInGrams: 0},
status: '',
title: ''
},
presentation: {backgroundColor: '', imageUrl: '', textColor: ''},
taxCode: '',
taxExempt: false,
taxRates: [],
unitName: '',
uuid: '',
variantOptionDefinitions: {definitions: [{name: '', properties: [{imageUrl: '', value: ''}]}]},
variants: [
{
barcode: '',
costPrice: {amount: 0, currencyId: ''},
description: '',
name: '',
options: [{name: '', value: ''}],
presentation: {},
price: {},
sku: '',
uuid: '',
vatPercentage: ''
}
],
vatPercentage: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationUuid/import/v2';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"products":[{"categories":[],"category":{"name":"","uuid":""},"description":"","externalReference":"","imageLookupKeys":[],"metadata":{"inPos":false,"source":{"external":false,"name":""}},"name":"","online":{"description":"","presentation":{"additionalImageUrls":[],"displayImageUrl":"","mediaUrls":[]},"seo":{"metaDescription":"","slug":"","title":""},"shipping":{"shippingPricingModel":"","weight":{"unit":"","weight":""},"weightInGrams":0},"status":"","title":""},"presentation":{"backgroundColor":"","imageUrl":"","textColor":""},"taxCode":"","taxExempt":false,"taxRates":[],"unitName":"","uuid":"","variantOptionDefinitions":{"definitions":[{"name":"","properties":[{"imageUrl":"","value":""}]}]},"variants":[{"barcode":"","costPrice":{"amount":0,"currencyId":""},"description":"","name":"","options":[{"name":"","value":""}],"presentation":{},"price":{},"sku":"","uuid":"","vatPercentage":""}],"vatPercentage":""}]}'
};
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}}/organizations/:organizationUuid/import/v2',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "products": [\n {\n "categories": [],\n "category": {\n "name": "",\n "uuid": ""\n },\n "description": "",\n "externalReference": "",\n "imageLookupKeys": [],\n "metadata": {\n "inPos": false,\n "source": {\n "external": false,\n "name": ""\n }\n },\n "name": "",\n "online": {\n "description": "",\n "presentation": {\n "additionalImageUrls": [],\n "displayImageUrl": "",\n "mediaUrls": []\n },\n "seo": {\n "metaDescription": "",\n "slug": "",\n "title": ""\n },\n "shipping": {\n "shippingPricingModel": "",\n "weight": {\n "unit": "",\n "weight": ""\n },\n "weightInGrams": 0\n },\n "status": "",\n "title": ""\n },\n "presentation": {\n "backgroundColor": "",\n "imageUrl": "",\n "textColor": ""\n },\n "taxCode": "",\n "taxExempt": false,\n "taxRates": [],\n "unitName": "",\n "uuid": "",\n "variantOptionDefinitions": {\n "definitions": [\n {\n "name": "",\n "properties": [\n {\n "imageUrl": "",\n "value": ""\n }\n ]\n }\n ]\n },\n "variants": [\n {\n "barcode": "",\n "costPrice": {\n "amount": 0,\n "currencyId": ""\n },\n "description": "",\n "name": "",\n "options": [\n {\n "name": "",\n "value": ""\n }\n ],\n "presentation": {},\n "price": {},\n "sku": "",\n "uuid": "",\n "vatPercentage": ""\n }\n ],\n "vatPercentage": ""\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 \"products\": [\n {\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationUuid/import/v2")
.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/organizations/:organizationUuid/import/v2',
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({
products: [
{
categories: [],
category: {name: '', uuid: ''},
description: '',
externalReference: '',
imageLookupKeys: [],
metadata: {inPos: false, source: {external: false, name: ''}},
name: '',
online: {
description: '',
presentation: {additionalImageUrls: [], displayImageUrl: '', mediaUrls: []},
seo: {metaDescription: '', slug: '', title: ''},
shipping: {shippingPricingModel: '', weight: {unit: '', weight: ''}, weightInGrams: 0},
status: '',
title: ''
},
presentation: {backgroundColor: '', imageUrl: '', textColor: ''},
taxCode: '',
taxExempt: false,
taxRates: [],
unitName: '',
uuid: '',
variantOptionDefinitions: {definitions: [{name: '', properties: [{imageUrl: '', value: ''}]}]},
variants: [
{
barcode: '',
costPrice: {amount: 0, currencyId: ''},
description: '',
name: '',
options: [{name: '', value: ''}],
presentation: {},
price: {},
sku: '',
uuid: '',
vatPercentage: ''
}
],
vatPercentage: ''
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationUuid/import/v2',
headers: {'content-type': 'application/json'},
body: {
products: [
{
categories: [],
category: {name: '', uuid: ''},
description: '',
externalReference: '',
imageLookupKeys: [],
metadata: {inPos: false, source: {external: false, name: ''}},
name: '',
online: {
description: '',
presentation: {additionalImageUrls: [], displayImageUrl: '', mediaUrls: []},
seo: {metaDescription: '', slug: '', title: ''},
shipping: {shippingPricingModel: '', weight: {unit: '', weight: ''}, weightInGrams: 0},
status: '',
title: ''
},
presentation: {backgroundColor: '', imageUrl: '', textColor: ''},
taxCode: '',
taxExempt: false,
taxRates: [],
unitName: '',
uuid: '',
variantOptionDefinitions: {definitions: [{name: '', properties: [{imageUrl: '', value: ''}]}]},
variants: [
{
barcode: '',
costPrice: {amount: 0, currencyId: ''},
description: '',
name: '',
options: [{name: '', value: ''}],
presentation: {},
price: {},
sku: '',
uuid: '',
vatPercentage: ''
}
],
vatPercentage: ''
}
]
},
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}}/organizations/:organizationUuid/import/v2');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
products: [
{
categories: [],
category: {
name: '',
uuid: ''
},
description: '',
externalReference: '',
imageLookupKeys: [],
metadata: {
inPos: false,
source: {
external: false,
name: ''
}
},
name: '',
online: {
description: '',
presentation: {
additionalImageUrls: [],
displayImageUrl: '',
mediaUrls: []
},
seo: {
metaDescription: '',
slug: '',
title: ''
},
shipping: {
shippingPricingModel: '',
weight: {
unit: '',
weight: ''
},
weightInGrams: 0
},
status: '',
title: ''
},
presentation: {
backgroundColor: '',
imageUrl: '',
textColor: ''
},
taxCode: '',
taxExempt: false,
taxRates: [],
unitName: '',
uuid: '',
variantOptionDefinitions: {
definitions: [
{
name: '',
properties: [
{
imageUrl: '',
value: ''
}
]
}
]
},
variants: [
{
barcode: '',
costPrice: {
amount: 0,
currencyId: ''
},
description: '',
name: '',
options: [
{
name: '',
value: ''
}
],
presentation: {},
price: {},
sku: '',
uuid: '',
vatPercentage: ''
}
],
vatPercentage: ''
}
]
});
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}}/organizations/:organizationUuid/import/v2',
headers: {'content-type': 'application/json'},
data: {
products: [
{
categories: [],
category: {name: '', uuid: ''},
description: '',
externalReference: '',
imageLookupKeys: [],
metadata: {inPos: false, source: {external: false, name: ''}},
name: '',
online: {
description: '',
presentation: {additionalImageUrls: [], displayImageUrl: '', mediaUrls: []},
seo: {metaDescription: '', slug: '', title: ''},
shipping: {shippingPricingModel: '', weight: {unit: '', weight: ''}, weightInGrams: 0},
status: '',
title: ''
},
presentation: {backgroundColor: '', imageUrl: '', textColor: ''},
taxCode: '',
taxExempt: false,
taxRates: [],
unitName: '',
uuid: '',
variantOptionDefinitions: {definitions: [{name: '', properties: [{imageUrl: '', value: ''}]}]},
variants: [
{
barcode: '',
costPrice: {amount: 0, currencyId: ''},
description: '',
name: '',
options: [{name: '', value: ''}],
presentation: {},
price: {},
sku: '',
uuid: '',
vatPercentage: ''
}
],
vatPercentage: ''
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationUuid/import/v2';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"products":[{"categories":[],"category":{"name":"","uuid":""},"description":"","externalReference":"","imageLookupKeys":[],"metadata":{"inPos":false,"source":{"external":false,"name":""}},"name":"","online":{"description":"","presentation":{"additionalImageUrls":[],"displayImageUrl":"","mediaUrls":[]},"seo":{"metaDescription":"","slug":"","title":""},"shipping":{"shippingPricingModel":"","weight":{"unit":"","weight":""},"weightInGrams":0},"status":"","title":""},"presentation":{"backgroundColor":"","imageUrl":"","textColor":""},"taxCode":"","taxExempt":false,"taxRates":[],"unitName":"","uuid":"","variantOptionDefinitions":{"definitions":[{"name":"","properties":[{"imageUrl":"","value":""}]}]},"variants":[{"barcode":"","costPrice":{"amount":0,"currencyId":""},"description":"","name":"","options":[{"name":"","value":""}],"presentation":{},"price":{},"sku":"","uuid":"","vatPercentage":""}],"vatPercentage":""}]}'
};
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 = @{ @"products": @[ @{ @"categories": @[ ], @"category": @{ @"name": @"", @"uuid": @"" }, @"description": @"", @"externalReference": @"", @"imageLookupKeys": @[ ], @"metadata": @{ @"inPos": @NO, @"source": @{ @"external": @NO, @"name": @"" } }, @"name": @"", @"online": @{ @"description": @"", @"presentation": @{ @"additionalImageUrls": @[ ], @"displayImageUrl": @"", @"mediaUrls": @[ ] }, @"seo": @{ @"metaDescription": @"", @"slug": @"", @"title": @"" }, @"shipping": @{ @"shippingPricingModel": @"", @"weight": @{ @"unit": @"", @"weight": @"" }, @"weightInGrams": @0 }, @"status": @"", @"title": @"" }, @"presentation": @{ @"backgroundColor": @"", @"imageUrl": @"", @"textColor": @"" }, @"taxCode": @"", @"taxExempt": @NO, @"taxRates": @[ ], @"unitName": @"", @"uuid": @"", @"variantOptionDefinitions": @{ @"definitions": @[ @{ @"name": @"", @"properties": @[ @{ @"imageUrl": @"", @"value": @"" } ] } ] }, @"variants": @[ @{ @"barcode": @"", @"costPrice": @{ @"amount": @0, @"currencyId": @"" }, @"description": @"", @"name": @"", @"options": @[ @{ @"name": @"", @"value": @"" } ], @"presentation": @{ }, @"price": @{ }, @"sku": @"", @"uuid": @"", @"vatPercentage": @"" } ], @"vatPercentage": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/organizations/:organizationUuid/import/v2"]
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}}/organizations/:organizationUuid/import/v2" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"products\": [\n {\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationUuid/import/v2",
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([
'products' => [
[
'categories' => [
],
'category' => [
'name' => '',
'uuid' => ''
],
'description' => '',
'externalReference' => '',
'imageLookupKeys' => [
],
'metadata' => [
'inPos' => null,
'source' => [
'external' => null,
'name' => ''
]
],
'name' => '',
'online' => [
'description' => '',
'presentation' => [
'additionalImageUrls' => [
],
'displayImageUrl' => '',
'mediaUrls' => [
]
],
'seo' => [
'metaDescription' => '',
'slug' => '',
'title' => ''
],
'shipping' => [
'shippingPricingModel' => '',
'weight' => [
'unit' => '',
'weight' => ''
],
'weightInGrams' => 0
],
'status' => '',
'title' => ''
],
'presentation' => [
'backgroundColor' => '',
'imageUrl' => '',
'textColor' => ''
],
'taxCode' => '',
'taxExempt' => null,
'taxRates' => [
],
'unitName' => '',
'uuid' => '',
'variantOptionDefinitions' => [
'definitions' => [
[
'name' => '',
'properties' => [
[
'imageUrl' => '',
'value' => ''
]
]
]
]
],
'variants' => [
[
'barcode' => '',
'costPrice' => [
'amount' => 0,
'currencyId' => ''
],
'description' => '',
'name' => '',
'options' => [
[
'name' => '',
'value' => ''
]
],
'presentation' => [
],
'price' => [
],
'sku' => '',
'uuid' => '',
'vatPercentage' => ''
]
],
'vatPercentage' => ''
]
]
]),
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}}/organizations/:organizationUuid/import/v2', [
'body' => '{
"products": [
{
"categories": [],
"category": {
"name": "",
"uuid": ""
},
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"metadata": {
"inPos": false,
"source": {
"external": false,
"name": ""
}
},
"name": "",
"online": {
"description": "",
"presentation": {
"additionalImageUrls": [],
"displayImageUrl": "",
"mediaUrls": []
},
"seo": {
"metaDescription": "",
"slug": "",
"title": ""
},
"shipping": {
"shippingPricingModel": "",
"weight": {
"unit": "",
"weight": ""
},
"weightInGrams": 0
},
"status": "",
"title": ""
},
"presentation": {
"backgroundColor": "",
"imageUrl": "",
"textColor": ""
},
"taxCode": "",
"taxExempt": false,
"taxRates": [],
"unitName": "",
"uuid": "",
"variantOptionDefinitions": {
"definitions": [
{
"name": "",
"properties": [
{
"imageUrl": "",
"value": ""
}
]
}
]
},
"variants": [
{
"barcode": "",
"costPrice": {
"amount": 0,
"currencyId": ""
},
"description": "",
"name": "",
"options": [
{
"name": "",
"value": ""
}
],
"presentation": {},
"price": {},
"sku": "",
"uuid": "",
"vatPercentage": ""
}
],
"vatPercentage": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationUuid/import/v2');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'products' => [
[
'categories' => [
],
'category' => [
'name' => '',
'uuid' => ''
],
'description' => '',
'externalReference' => '',
'imageLookupKeys' => [
],
'metadata' => [
'inPos' => null,
'source' => [
'external' => null,
'name' => ''
]
],
'name' => '',
'online' => [
'description' => '',
'presentation' => [
'additionalImageUrls' => [
],
'displayImageUrl' => '',
'mediaUrls' => [
]
],
'seo' => [
'metaDescription' => '',
'slug' => '',
'title' => ''
],
'shipping' => [
'shippingPricingModel' => '',
'weight' => [
'unit' => '',
'weight' => ''
],
'weightInGrams' => 0
],
'status' => '',
'title' => ''
],
'presentation' => [
'backgroundColor' => '',
'imageUrl' => '',
'textColor' => ''
],
'taxCode' => '',
'taxExempt' => null,
'taxRates' => [
],
'unitName' => '',
'uuid' => '',
'variantOptionDefinitions' => [
'definitions' => [
[
'name' => '',
'properties' => [
[
'imageUrl' => '',
'value' => ''
]
]
]
]
],
'variants' => [
[
'barcode' => '',
'costPrice' => [
'amount' => 0,
'currencyId' => ''
],
'description' => '',
'name' => '',
'options' => [
[
'name' => '',
'value' => ''
]
],
'presentation' => [
],
'price' => [
],
'sku' => '',
'uuid' => '',
'vatPercentage' => ''
]
],
'vatPercentage' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'products' => [
[
'categories' => [
],
'category' => [
'name' => '',
'uuid' => ''
],
'description' => '',
'externalReference' => '',
'imageLookupKeys' => [
],
'metadata' => [
'inPos' => null,
'source' => [
'external' => null,
'name' => ''
]
],
'name' => '',
'online' => [
'description' => '',
'presentation' => [
'additionalImageUrls' => [
],
'displayImageUrl' => '',
'mediaUrls' => [
]
],
'seo' => [
'metaDescription' => '',
'slug' => '',
'title' => ''
],
'shipping' => [
'shippingPricingModel' => '',
'weight' => [
'unit' => '',
'weight' => ''
],
'weightInGrams' => 0
],
'status' => '',
'title' => ''
],
'presentation' => [
'backgroundColor' => '',
'imageUrl' => '',
'textColor' => ''
],
'taxCode' => '',
'taxExempt' => null,
'taxRates' => [
],
'unitName' => '',
'uuid' => '',
'variantOptionDefinitions' => [
'definitions' => [
[
'name' => '',
'properties' => [
[
'imageUrl' => '',
'value' => ''
]
]
]
]
],
'variants' => [
[
'barcode' => '',
'costPrice' => [
'amount' => 0,
'currencyId' => ''
],
'description' => '',
'name' => '',
'options' => [
[
'name' => '',
'value' => ''
]
],
'presentation' => [
],
'price' => [
],
'sku' => '',
'uuid' => '',
'vatPercentage' => ''
]
],
'vatPercentage' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/organizations/:organizationUuid/import/v2');
$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}}/organizations/:organizationUuid/import/v2' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"products": [
{
"categories": [],
"category": {
"name": "",
"uuid": ""
},
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"metadata": {
"inPos": false,
"source": {
"external": false,
"name": ""
}
},
"name": "",
"online": {
"description": "",
"presentation": {
"additionalImageUrls": [],
"displayImageUrl": "",
"mediaUrls": []
},
"seo": {
"metaDescription": "",
"slug": "",
"title": ""
},
"shipping": {
"shippingPricingModel": "",
"weight": {
"unit": "",
"weight": ""
},
"weightInGrams": 0
},
"status": "",
"title": ""
},
"presentation": {
"backgroundColor": "",
"imageUrl": "",
"textColor": ""
},
"taxCode": "",
"taxExempt": false,
"taxRates": [],
"unitName": "",
"uuid": "",
"variantOptionDefinitions": {
"definitions": [
{
"name": "",
"properties": [
{
"imageUrl": "",
"value": ""
}
]
}
]
},
"variants": [
{
"barcode": "",
"costPrice": {
"amount": 0,
"currencyId": ""
},
"description": "",
"name": "",
"options": [
{
"name": "",
"value": ""
}
],
"presentation": {},
"price": {},
"sku": "",
"uuid": "",
"vatPercentage": ""
}
],
"vatPercentage": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationUuid/import/v2' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"products": [
{
"categories": [],
"category": {
"name": "",
"uuid": ""
},
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"metadata": {
"inPos": false,
"source": {
"external": false,
"name": ""
}
},
"name": "",
"online": {
"description": "",
"presentation": {
"additionalImageUrls": [],
"displayImageUrl": "",
"mediaUrls": []
},
"seo": {
"metaDescription": "",
"slug": "",
"title": ""
},
"shipping": {
"shippingPricingModel": "",
"weight": {
"unit": "",
"weight": ""
},
"weightInGrams": 0
},
"status": "",
"title": ""
},
"presentation": {
"backgroundColor": "",
"imageUrl": "",
"textColor": ""
},
"taxCode": "",
"taxExempt": false,
"taxRates": [],
"unitName": "",
"uuid": "",
"variantOptionDefinitions": {
"definitions": [
{
"name": "",
"properties": [
{
"imageUrl": "",
"value": ""
}
]
}
]
},
"variants": [
{
"barcode": "",
"costPrice": {
"amount": 0,
"currencyId": ""
},
"description": "",
"name": "",
"options": [
{
"name": "",
"value": ""
}
],
"presentation": {},
"price": {},
"sku": "",
"uuid": "",
"vatPercentage": ""
}
],
"vatPercentage": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"products\": [\n {\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/organizations/:organizationUuid/import/v2", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationUuid/import/v2"
payload = { "products": [
{
"categories": [],
"category": {
"name": "",
"uuid": ""
},
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"metadata": {
"inPos": False,
"source": {
"external": False,
"name": ""
}
},
"name": "",
"online": {
"description": "",
"presentation": {
"additionalImageUrls": [],
"displayImageUrl": "",
"mediaUrls": []
},
"seo": {
"metaDescription": "",
"slug": "",
"title": ""
},
"shipping": {
"shippingPricingModel": "",
"weight": {
"unit": "",
"weight": ""
},
"weightInGrams": 0
},
"status": "",
"title": ""
},
"presentation": {
"backgroundColor": "",
"imageUrl": "",
"textColor": ""
},
"taxCode": "",
"taxExempt": False,
"taxRates": [],
"unitName": "",
"uuid": "",
"variantOptionDefinitions": { "definitions": [
{
"name": "",
"properties": [
{
"imageUrl": "",
"value": ""
}
]
}
] },
"variants": [
{
"barcode": "",
"costPrice": {
"amount": 0,
"currencyId": ""
},
"description": "",
"name": "",
"options": [
{
"name": "",
"value": ""
}
],
"presentation": {},
"price": {},
"sku": "",
"uuid": "",
"vatPercentage": ""
}
],
"vatPercentage": ""
}
] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationUuid/import/v2"
payload <- "{\n \"products\": [\n {\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\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}}/organizations/:organizationUuid/import/v2")
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 \"products\": [\n {\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\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/organizations/:organizationUuid/import/v2') do |req|
req.body = "{\n \"products\": [\n {\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\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}}/organizations/:organizationUuid/import/v2";
let payload = json!({"products": (
json!({
"categories": (),
"category": json!({
"name": "",
"uuid": ""
}),
"description": "",
"externalReference": "",
"imageLookupKeys": (),
"metadata": json!({
"inPos": false,
"source": json!({
"external": false,
"name": ""
})
}),
"name": "",
"online": json!({
"description": "",
"presentation": json!({
"additionalImageUrls": (),
"displayImageUrl": "",
"mediaUrls": ()
}),
"seo": json!({
"metaDescription": "",
"slug": "",
"title": ""
}),
"shipping": json!({
"shippingPricingModel": "",
"weight": json!({
"unit": "",
"weight": ""
}),
"weightInGrams": 0
}),
"status": "",
"title": ""
}),
"presentation": json!({
"backgroundColor": "",
"imageUrl": "",
"textColor": ""
}),
"taxCode": "",
"taxExempt": false,
"taxRates": (),
"unitName": "",
"uuid": "",
"variantOptionDefinitions": json!({"definitions": (
json!({
"name": "",
"properties": (
json!({
"imageUrl": "",
"value": ""
})
)
})
)}),
"variants": (
json!({
"barcode": "",
"costPrice": json!({
"amount": 0,
"currencyId": ""
}),
"description": "",
"name": "",
"options": (
json!({
"name": "",
"value": ""
})
),
"presentation": json!({}),
"price": json!({}),
"sku": "",
"uuid": "",
"vatPercentage": ""
})
),
"vatPercentage": ""
})
)});
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}}/organizations/:organizationUuid/import/v2 \
--header 'content-type: application/json' \
--data '{
"products": [
{
"categories": [],
"category": {
"name": "",
"uuid": ""
},
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"metadata": {
"inPos": false,
"source": {
"external": false,
"name": ""
}
},
"name": "",
"online": {
"description": "",
"presentation": {
"additionalImageUrls": [],
"displayImageUrl": "",
"mediaUrls": []
},
"seo": {
"metaDescription": "",
"slug": "",
"title": ""
},
"shipping": {
"shippingPricingModel": "",
"weight": {
"unit": "",
"weight": ""
},
"weightInGrams": 0
},
"status": "",
"title": ""
},
"presentation": {
"backgroundColor": "",
"imageUrl": "",
"textColor": ""
},
"taxCode": "",
"taxExempt": false,
"taxRates": [],
"unitName": "",
"uuid": "",
"variantOptionDefinitions": {
"definitions": [
{
"name": "",
"properties": [
{
"imageUrl": "",
"value": ""
}
]
}
]
},
"variants": [
{
"barcode": "",
"costPrice": {
"amount": 0,
"currencyId": ""
},
"description": "",
"name": "",
"options": [
{
"name": "",
"value": ""
}
],
"presentation": {},
"price": {},
"sku": "",
"uuid": "",
"vatPercentage": ""
}
],
"vatPercentage": ""
}
]
}'
echo '{
"products": [
{
"categories": [],
"category": {
"name": "",
"uuid": ""
},
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"metadata": {
"inPos": false,
"source": {
"external": false,
"name": ""
}
},
"name": "",
"online": {
"description": "",
"presentation": {
"additionalImageUrls": [],
"displayImageUrl": "",
"mediaUrls": []
},
"seo": {
"metaDescription": "",
"slug": "",
"title": ""
},
"shipping": {
"shippingPricingModel": "",
"weight": {
"unit": "",
"weight": ""
},
"weightInGrams": 0
},
"status": "",
"title": ""
},
"presentation": {
"backgroundColor": "",
"imageUrl": "",
"textColor": ""
},
"taxCode": "",
"taxExempt": false,
"taxRates": [],
"unitName": "",
"uuid": "",
"variantOptionDefinitions": {
"definitions": [
{
"name": "",
"properties": [
{
"imageUrl": "",
"value": ""
}
]
}
]
},
"variants": [
{
"barcode": "",
"costPrice": {
"amount": 0,
"currencyId": ""
},
"description": "",
"name": "",
"options": [
{
"name": "",
"value": ""
}
],
"presentation": {},
"price": {},
"sku": "",
"uuid": "",
"vatPercentage": ""
}
],
"vatPercentage": ""
}
]
}' | \
http POST {{baseUrl}}/organizations/:organizationUuid/import/v2 \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "products": [\n {\n "categories": [],\n "category": {\n "name": "",\n "uuid": ""\n },\n "description": "",\n "externalReference": "",\n "imageLookupKeys": [],\n "metadata": {\n "inPos": false,\n "source": {\n "external": false,\n "name": ""\n }\n },\n "name": "",\n "online": {\n "description": "",\n "presentation": {\n "additionalImageUrls": [],\n "displayImageUrl": "",\n "mediaUrls": []\n },\n "seo": {\n "metaDescription": "",\n "slug": "",\n "title": ""\n },\n "shipping": {\n "shippingPricingModel": "",\n "weight": {\n "unit": "",\n "weight": ""\n },\n "weightInGrams": 0\n },\n "status": "",\n "title": ""\n },\n "presentation": {\n "backgroundColor": "",\n "imageUrl": "",\n "textColor": ""\n },\n "taxCode": "",\n "taxExempt": false,\n "taxRates": [],\n "unitName": "",\n "uuid": "",\n "variantOptionDefinitions": {\n "definitions": [\n {\n "name": "",\n "properties": [\n {\n "imageUrl": "",\n "value": ""\n }\n ]\n }\n ]\n },\n "variants": [\n {\n "barcode": "",\n "costPrice": {\n "amount": 0,\n "currencyId": ""\n },\n "description": "",\n "name": "",\n "options": [\n {\n "name": "",\n "value": ""\n }\n ],\n "presentation": {},\n "price": {},\n "sku": "",\n "uuid": "",\n "vatPercentage": ""\n }\n ],\n "vatPercentage": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/organizations/:organizationUuid/import/v2
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["products": [
[
"categories": [],
"category": [
"name": "",
"uuid": ""
],
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"metadata": [
"inPos": false,
"source": [
"external": false,
"name": ""
]
],
"name": "",
"online": [
"description": "",
"presentation": [
"additionalImageUrls": [],
"displayImageUrl": "",
"mediaUrls": []
],
"seo": [
"metaDescription": "",
"slug": "",
"title": ""
],
"shipping": [
"shippingPricingModel": "",
"weight": [
"unit": "",
"weight": ""
],
"weightInGrams": 0
],
"status": "",
"title": ""
],
"presentation": [
"backgroundColor": "",
"imageUrl": "",
"textColor": ""
],
"taxCode": "",
"taxExempt": false,
"taxRates": [],
"unitName": "",
"uuid": "",
"variantOptionDefinitions": ["definitions": [
[
"name": "",
"properties": [
[
"imageUrl": "",
"value": ""
]
]
]
]],
"variants": [
[
"barcode": "",
"costPrice": [
"amount": 0,
"currencyId": ""
],
"description": "",
"name": "",
"options": [
[
"name": "",
"value": ""
]
],
"presentation": [],
"price": [],
"sku": "",
"uuid": "",
"vatPercentage": ""
]
],
"vatPercentage": ""
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationUuid/import/v2")! 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
Retrieve the entire library
{{baseUrl}}/organizations/:organizationUuid/library
QUERY PARAMS
organizationUuid
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationUuid/library");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations/:organizationUuid/library")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationUuid/library"
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}}/organizations/:organizationUuid/library"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationUuid/library");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationUuid/library"
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/organizations/:organizationUuid/library HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations/:organizationUuid/library")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationUuid/library"))
.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}}/organizations/:organizationUuid/library")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations/:organizationUuid/library")
.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}}/organizations/:organizationUuid/library');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/organizations/:organizationUuid/library'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationUuid/library';
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}}/organizations/:organizationUuid/library',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationUuid/library")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationUuid/library',
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}}/organizations/:organizationUuid/library'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/organizations/:organizationUuid/library');
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}}/organizations/:organizationUuid/library'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationUuid/library';
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}}/organizations/:organizationUuid/library"]
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}}/organizations/:organizationUuid/library" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationUuid/library",
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}}/organizations/:organizationUuid/library');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationUuid/library');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationUuid/library');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationUuid/library' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationUuid/library' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations/:organizationUuid/library")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationUuid/library"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationUuid/library"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationUuid/library")
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/organizations/:organizationUuid/library') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationUuid/library";
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}}/organizations/:organizationUuid/library
http GET {{baseUrl}}/organizations/:organizationUuid/library
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations/:organizationUuid/library
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationUuid/library")! 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
Create a new product
{{baseUrl}}/organizations/:organizationUuid/products
QUERY PARAMS
organizationUuid
BODY json
{
"categories": [],
"category": {
"name": "",
"uuid": ""
},
"createWithDefaultTax": false,
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"metadata": {
"inPos": false,
"source": {
"external": false,
"name": ""
}
},
"name": "",
"online": {
"description": "",
"presentation": {
"additionalImageUrls": [],
"displayImageUrl": "",
"mediaUrls": []
},
"seo": {
"metaDescription": "",
"slug": "",
"title": ""
},
"shipping": {
"shippingPricingModel": "",
"weight": {
"unit": "",
"weight": ""
},
"weightInGrams": 0
},
"status": "",
"title": ""
},
"presentation": {
"backgroundColor": "",
"imageUrl": "",
"textColor": ""
},
"taxCode": "",
"taxExempt": false,
"taxRates": [],
"unitName": "",
"uuid": "",
"variantOptionDefinitions": {
"definitions": [
{
"name": "",
"properties": [
{
"imageUrl": "",
"value": ""
}
]
}
]
},
"variants": [
{
"barcode": "",
"costPrice": {
"amount": 0,
"currencyId": ""
},
"description": "",
"name": "",
"options": [
{
"name": "",
"value": ""
}
],
"presentation": {},
"price": {},
"sku": "",
"uuid": "",
"vatPercentage": ""
}
],
"vatPercentage": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationUuid/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 \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"createWithDefaultTax\": false,\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/organizations/:organizationUuid/products" {:content-type :json
:form-params {:categories []
:category {:name ""
:uuid ""}
:createWithDefaultTax false
:description ""
:externalReference ""
:imageLookupKeys []
:metadata {:inPos false
:source {:external false
:name ""}}
:name ""
:online {:description ""
:presentation {:additionalImageUrls []
:displayImageUrl ""
:mediaUrls []}
:seo {:metaDescription ""
:slug ""
:title ""}
:shipping {:shippingPricingModel ""
:weight {:unit ""
:weight ""}
:weightInGrams 0}
:status ""
:title ""}
:presentation {:backgroundColor ""
:imageUrl ""
:textColor ""}
:taxCode ""
:taxExempt false
:taxRates []
:unitName ""
:uuid ""
:variantOptionDefinitions {:definitions [{:name ""
:properties [{:imageUrl ""
:value ""}]}]}
:variants [{:barcode ""
:costPrice {:amount 0
:currencyId ""}
:description ""
:name ""
:options [{:name ""
:value ""}]
:presentation {}
:price {}
:sku ""
:uuid ""
:vatPercentage ""}]
:vatPercentage ""}})
require "http/client"
url = "{{baseUrl}}/organizations/:organizationUuid/products"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"createWithDefaultTax\": false,\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\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}}/organizations/:organizationUuid/products"),
Content = new StringContent("{\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"createWithDefaultTax\": false,\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\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}}/organizations/:organizationUuid/products");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"createWithDefaultTax\": false,\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationUuid/products"
payload := strings.NewReader("{\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"createWithDefaultTax\": false,\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\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/organizations/:organizationUuid/products HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1510
{
"categories": [],
"category": {
"name": "",
"uuid": ""
},
"createWithDefaultTax": false,
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"metadata": {
"inPos": false,
"source": {
"external": false,
"name": ""
}
},
"name": "",
"online": {
"description": "",
"presentation": {
"additionalImageUrls": [],
"displayImageUrl": "",
"mediaUrls": []
},
"seo": {
"metaDescription": "",
"slug": "",
"title": ""
},
"shipping": {
"shippingPricingModel": "",
"weight": {
"unit": "",
"weight": ""
},
"weightInGrams": 0
},
"status": "",
"title": ""
},
"presentation": {
"backgroundColor": "",
"imageUrl": "",
"textColor": ""
},
"taxCode": "",
"taxExempt": false,
"taxRates": [],
"unitName": "",
"uuid": "",
"variantOptionDefinitions": {
"definitions": [
{
"name": "",
"properties": [
{
"imageUrl": "",
"value": ""
}
]
}
]
},
"variants": [
{
"barcode": "",
"costPrice": {
"amount": 0,
"currencyId": ""
},
"description": "",
"name": "",
"options": [
{
"name": "",
"value": ""
}
],
"presentation": {},
"price": {},
"sku": "",
"uuid": "",
"vatPercentage": ""
}
],
"vatPercentage": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/organizations/:organizationUuid/products")
.setHeader("content-type", "application/json")
.setBody("{\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"createWithDefaultTax\": false,\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationUuid/products"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"createWithDefaultTax\": false,\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\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 \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"createWithDefaultTax\": false,\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/organizations/:organizationUuid/products")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/organizations/:organizationUuid/products")
.header("content-type", "application/json")
.body("{\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"createWithDefaultTax\": false,\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\n}")
.asString();
const data = JSON.stringify({
categories: [],
category: {
name: '',
uuid: ''
},
createWithDefaultTax: false,
description: '',
externalReference: '',
imageLookupKeys: [],
metadata: {
inPos: false,
source: {
external: false,
name: ''
}
},
name: '',
online: {
description: '',
presentation: {
additionalImageUrls: [],
displayImageUrl: '',
mediaUrls: []
},
seo: {
metaDescription: '',
slug: '',
title: ''
},
shipping: {
shippingPricingModel: '',
weight: {
unit: '',
weight: ''
},
weightInGrams: 0
},
status: '',
title: ''
},
presentation: {
backgroundColor: '',
imageUrl: '',
textColor: ''
},
taxCode: '',
taxExempt: false,
taxRates: [],
unitName: '',
uuid: '',
variantOptionDefinitions: {
definitions: [
{
name: '',
properties: [
{
imageUrl: '',
value: ''
}
]
}
]
},
variants: [
{
barcode: '',
costPrice: {
amount: 0,
currencyId: ''
},
description: '',
name: '',
options: [
{
name: '',
value: ''
}
],
presentation: {},
price: {},
sku: '',
uuid: '',
vatPercentage: ''
}
],
vatPercentage: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/organizations/:organizationUuid/products');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationUuid/products',
headers: {'content-type': 'application/json'},
data: {
categories: [],
category: {name: '', uuid: ''},
createWithDefaultTax: false,
description: '',
externalReference: '',
imageLookupKeys: [],
metadata: {inPos: false, source: {external: false, name: ''}},
name: '',
online: {
description: '',
presentation: {additionalImageUrls: [], displayImageUrl: '', mediaUrls: []},
seo: {metaDescription: '', slug: '', title: ''},
shipping: {shippingPricingModel: '', weight: {unit: '', weight: ''}, weightInGrams: 0},
status: '',
title: ''
},
presentation: {backgroundColor: '', imageUrl: '', textColor: ''},
taxCode: '',
taxExempt: false,
taxRates: [],
unitName: '',
uuid: '',
variantOptionDefinitions: {definitions: [{name: '', properties: [{imageUrl: '', value: ''}]}]},
variants: [
{
barcode: '',
costPrice: {amount: 0, currencyId: ''},
description: '',
name: '',
options: [{name: '', value: ''}],
presentation: {},
price: {},
sku: '',
uuid: '',
vatPercentage: ''
}
],
vatPercentage: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationUuid/products';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"categories":[],"category":{"name":"","uuid":""},"createWithDefaultTax":false,"description":"","externalReference":"","imageLookupKeys":[],"metadata":{"inPos":false,"source":{"external":false,"name":""}},"name":"","online":{"description":"","presentation":{"additionalImageUrls":[],"displayImageUrl":"","mediaUrls":[]},"seo":{"metaDescription":"","slug":"","title":""},"shipping":{"shippingPricingModel":"","weight":{"unit":"","weight":""},"weightInGrams":0},"status":"","title":""},"presentation":{"backgroundColor":"","imageUrl":"","textColor":""},"taxCode":"","taxExempt":false,"taxRates":[],"unitName":"","uuid":"","variantOptionDefinitions":{"definitions":[{"name":"","properties":[{"imageUrl":"","value":""}]}]},"variants":[{"barcode":"","costPrice":{"amount":0,"currencyId":""},"description":"","name":"","options":[{"name":"","value":""}],"presentation":{},"price":{},"sku":"","uuid":"","vatPercentage":""}],"vatPercentage":""}'
};
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}}/organizations/:organizationUuid/products',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "categories": [],\n "category": {\n "name": "",\n "uuid": ""\n },\n "createWithDefaultTax": false,\n "description": "",\n "externalReference": "",\n "imageLookupKeys": [],\n "metadata": {\n "inPos": false,\n "source": {\n "external": false,\n "name": ""\n }\n },\n "name": "",\n "online": {\n "description": "",\n "presentation": {\n "additionalImageUrls": [],\n "displayImageUrl": "",\n "mediaUrls": []\n },\n "seo": {\n "metaDescription": "",\n "slug": "",\n "title": ""\n },\n "shipping": {\n "shippingPricingModel": "",\n "weight": {\n "unit": "",\n "weight": ""\n },\n "weightInGrams": 0\n },\n "status": "",\n "title": ""\n },\n "presentation": {\n "backgroundColor": "",\n "imageUrl": "",\n "textColor": ""\n },\n "taxCode": "",\n "taxExempt": false,\n "taxRates": [],\n "unitName": "",\n "uuid": "",\n "variantOptionDefinitions": {\n "definitions": [\n {\n "name": "",\n "properties": [\n {\n "imageUrl": "",\n "value": ""\n }\n ]\n }\n ]\n },\n "variants": [\n {\n "barcode": "",\n "costPrice": {\n "amount": 0,\n "currencyId": ""\n },\n "description": "",\n "name": "",\n "options": [\n {\n "name": "",\n "value": ""\n }\n ],\n "presentation": {},\n "price": {},\n "sku": "",\n "uuid": "",\n "vatPercentage": ""\n }\n ],\n "vatPercentage": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"createWithDefaultTax\": false,\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationUuid/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/organizations/:organizationUuid/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({
categories: [],
category: {name: '', uuid: ''},
createWithDefaultTax: false,
description: '',
externalReference: '',
imageLookupKeys: [],
metadata: {inPos: false, source: {external: false, name: ''}},
name: '',
online: {
description: '',
presentation: {additionalImageUrls: [], displayImageUrl: '', mediaUrls: []},
seo: {metaDescription: '', slug: '', title: ''},
shipping: {shippingPricingModel: '', weight: {unit: '', weight: ''}, weightInGrams: 0},
status: '',
title: ''
},
presentation: {backgroundColor: '', imageUrl: '', textColor: ''},
taxCode: '',
taxExempt: false,
taxRates: [],
unitName: '',
uuid: '',
variantOptionDefinitions: {definitions: [{name: '', properties: [{imageUrl: '', value: ''}]}]},
variants: [
{
barcode: '',
costPrice: {amount: 0, currencyId: ''},
description: '',
name: '',
options: [{name: '', value: ''}],
presentation: {},
price: {},
sku: '',
uuid: '',
vatPercentage: ''
}
],
vatPercentage: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationUuid/products',
headers: {'content-type': 'application/json'},
body: {
categories: [],
category: {name: '', uuid: ''},
createWithDefaultTax: false,
description: '',
externalReference: '',
imageLookupKeys: [],
metadata: {inPos: false, source: {external: false, name: ''}},
name: '',
online: {
description: '',
presentation: {additionalImageUrls: [], displayImageUrl: '', mediaUrls: []},
seo: {metaDescription: '', slug: '', title: ''},
shipping: {shippingPricingModel: '', weight: {unit: '', weight: ''}, weightInGrams: 0},
status: '',
title: ''
},
presentation: {backgroundColor: '', imageUrl: '', textColor: ''},
taxCode: '',
taxExempt: false,
taxRates: [],
unitName: '',
uuid: '',
variantOptionDefinitions: {definitions: [{name: '', properties: [{imageUrl: '', value: ''}]}]},
variants: [
{
barcode: '',
costPrice: {amount: 0, currencyId: ''},
description: '',
name: '',
options: [{name: '', value: ''}],
presentation: {},
price: {},
sku: '',
uuid: '',
vatPercentage: ''
}
],
vatPercentage: ''
},
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}}/organizations/:organizationUuid/products');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
categories: [],
category: {
name: '',
uuid: ''
},
createWithDefaultTax: false,
description: '',
externalReference: '',
imageLookupKeys: [],
metadata: {
inPos: false,
source: {
external: false,
name: ''
}
},
name: '',
online: {
description: '',
presentation: {
additionalImageUrls: [],
displayImageUrl: '',
mediaUrls: []
},
seo: {
metaDescription: '',
slug: '',
title: ''
},
shipping: {
shippingPricingModel: '',
weight: {
unit: '',
weight: ''
},
weightInGrams: 0
},
status: '',
title: ''
},
presentation: {
backgroundColor: '',
imageUrl: '',
textColor: ''
},
taxCode: '',
taxExempt: false,
taxRates: [],
unitName: '',
uuid: '',
variantOptionDefinitions: {
definitions: [
{
name: '',
properties: [
{
imageUrl: '',
value: ''
}
]
}
]
},
variants: [
{
barcode: '',
costPrice: {
amount: 0,
currencyId: ''
},
description: '',
name: '',
options: [
{
name: '',
value: ''
}
],
presentation: {},
price: {},
sku: '',
uuid: '',
vatPercentage: ''
}
],
vatPercentage: ''
});
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}}/organizations/:organizationUuid/products',
headers: {'content-type': 'application/json'},
data: {
categories: [],
category: {name: '', uuid: ''},
createWithDefaultTax: false,
description: '',
externalReference: '',
imageLookupKeys: [],
metadata: {inPos: false, source: {external: false, name: ''}},
name: '',
online: {
description: '',
presentation: {additionalImageUrls: [], displayImageUrl: '', mediaUrls: []},
seo: {metaDescription: '', slug: '', title: ''},
shipping: {shippingPricingModel: '', weight: {unit: '', weight: ''}, weightInGrams: 0},
status: '',
title: ''
},
presentation: {backgroundColor: '', imageUrl: '', textColor: ''},
taxCode: '',
taxExempt: false,
taxRates: [],
unitName: '',
uuid: '',
variantOptionDefinitions: {definitions: [{name: '', properties: [{imageUrl: '', value: ''}]}]},
variants: [
{
barcode: '',
costPrice: {amount: 0, currencyId: ''},
description: '',
name: '',
options: [{name: '', value: ''}],
presentation: {},
price: {},
sku: '',
uuid: '',
vatPercentage: ''
}
],
vatPercentage: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationUuid/products';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"categories":[],"category":{"name":"","uuid":""},"createWithDefaultTax":false,"description":"","externalReference":"","imageLookupKeys":[],"metadata":{"inPos":false,"source":{"external":false,"name":""}},"name":"","online":{"description":"","presentation":{"additionalImageUrls":[],"displayImageUrl":"","mediaUrls":[]},"seo":{"metaDescription":"","slug":"","title":""},"shipping":{"shippingPricingModel":"","weight":{"unit":"","weight":""},"weightInGrams":0},"status":"","title":""},"presentation":{"backgroundColor":"","imageUrl":"","textColor":""},"taxCode":"","taxExempt":false,"taxRates":[],"unitName":"","uuid":"","variantOptionDefinitions":{"definitions":[{"name":"","properties":[{"imageUrl":"","value":""}]}]},"variants":[{"barcode":"","costPrice":{"amount":0,"currencyId":""},"description":"","name":"","options":[{"name":"","value":""}],"presentation":{},"price":{},"sku":"","uuid":"","vatPercentage":""}],"vatPercentage":""}'
};
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 = @{ @"categories": @[ ],
@"category": @{ @"name": @"", @"uuid": @"" },
@"createWithDefaultTax": @NO,
@"description": @"",
@"externalReference": @"",
@"imageLookupKeys": @[ ],
@"metadata": @{ @"inPos": @NO, @"source": @{ @"external": @NO, @"name": @"" } },
@"name": @"",
@"online": @{ @"description": @"", @"presentation": @{ @"additionalImageUrls": @[ ], @"displayImageUrl": @"", @"mediaUrls": @[ ] }, @"seo": @{ @"metaDescription": @"", @"slug": @"", @"title": @"" }, @"shipping": @{ @"shippingPricingModel": @"", @"weight": @{ @"unit": @"", @"weight": @"" }, @"weightInGrams": @0 }, @"status": @"", @"title": @"" },
@"presentation": @{ @"backgroundColor": @"", @"imageUrl": @"", @"textColor": @"" },
@"taxCode": @"",
@"taxExempt": @NO,
@"taxRates": @[ ],
@"unitName": @"",
@"uuid": @"",
@"variantOptionDefinitions": @{ @"definitions": @[ @{ @"name": @"", @"properties": @[ @{ @"imageUrl": @"", @"value": @"" } ] } ] },
@"variants": @[ @{ @"barcode": @"", @"costPrice": @{ @"amount": @0, @"currencyId": @"" }, @"description": @"", @"name": @"", @"options": @[ @{ @"name": @"", @"value": @"" } ], @"presentation": @{ }, @"price": @{ }, @"sku": @"", @"uuid": @"", @"vatPercentage": @"" } ],
@"vatPercentage": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/organizations/:organizationUuid/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}}/organizations/:organizationUuid/products" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"createWithDefaultTax\": false,\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationUuid/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([
'categories' => [
],
'category' => [
'name' => '',
'uuid' => ''
],
'createWithDefaultTax' => null,
'description' => '',
'externalReference' => '',
'imageLookupKeys' => [
],
'metadata' => [
'inPos' => null,
'source' => [
'external' => null,
'name' => ''
]
],
'name' => '',
'online' => [
'description' => '',
'presentation' => [
'additionalImageUrls' => [
],
'displayImageUrl' => '',
'mediaUrls' => [
]
],
'seo' => [
'metaDescription' => '',
'slug' => '',
'title' => ''
],
'shipping' => [
'shippingPricingModel' => '',
'weight' => [
'unit' => '',
'weight' => ''
],
'weightInGrams' => 0
],
'status' => '',
'title' => ''
],
'presentation' => [
'backgroundColor' => '',
'imageUrl' => '',
'textColor' => ''
],
'taxCode' => '',
'taxExempt' => null,
'taxRates' => [
],
'unitName' => '',
'uuid' => '',
'variantOptionDefinitions' => [
'definitions' => [
[
'name' => '',
'properties' => [
[
'imageUrl' => '',
'value' => ''
]
]
]
]
],
'variants' => [
[
'barcode' => '',
'costPrice' => [
'amount' => 0,
'currencyId' => ''
],
'description' => '',
'name' => '',
'options' => [
[
'name' => '',
'value' => ''
]
],
'presentation' => [
],
'price' => [
],
'sku' => '',
'uuid' => '',
'vatPercentage' => ''
]
],
'vatPercentage' => ''
]),
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}}/organizations/:organizationUuid/products', [
'body' => '{
"categories": [],
"category": {
"name": "",
"uuid": ""
},
"createWithDefaultTax": false,
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"metadata": {
"inPos": false,
"source": {
"external": false,
"name": ""
}
},
"name": "",
"online": {
"description": "",
"presentation": {
"additionalImageUrls": [],
"displayImageUrl": "",
"mediaUrls": []
},
"seo": {
"metaDescription": "",
"slug": "",
"title": ""
},
"shipping": {
"shippingPricingModel": "",
"weight": {
"unit": "",
"weight": ""
},
"weightInGrams": 0
},
"status": "",
"title": ""
},
"presentation": {
"backgroundColor": "",
"imageUrl": "",
"textColor": ""
},
"taxCode": "",
"taxExempt": false,
"taxRates": [],
"unitName": "",
"uuid": "",
"variantOptionDefinitions": {
"definitions": [
{
"name": "",
"properties": [
{
"imageUrl": "",
"value": ""
}
]
}
]
},
"variants": [
{
"barcode": "",
"costPrice": {
"amount": 0,
"currencyId": ""
},
"description": "",
"name": "",
"options": [
{
"name": "",
"value": ""
}
],
"presentation": {},
"price": {},
"sku": "",
"uuid": "",
"vatPercentage": ""
}
],
"vatPercentage": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationUuid/products');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'categories' => [
],
'category' => [
'name' => '',
'uuid' => ''
],
'createWithDefaultTax' => null,
'description' => '',
'externalReference' => '',
'imageLookupKeys' => [
],
'metadata' => [
'inPos' => null,
'source' => [
'external' => null,
'name' => ''
]
],
'name' => '',
'online' => [
'description' => '',
'presentation' => [
'additionalImageUrls' => [
],
'displayImageUrl' => '',
'mediaUrls' => [
]
],
'seo' => [
'metaDescription' => '',
'slug' => '',
'title' => ''
],
'shipping' => [
'shippingPricingModel' => '',
'weight' => [
'unit' => '',
'weight' => ''
],
'weightInGrams' => 0
],
'status' => '',
'title' => ''
],
'presentation' => [
'backgroundColor' => '',
'imageUrl' => '',
'textColor' => ''
],
'taxCode' => '',
'taxExempt' => null,
'taxRates' => [
],
'unitName' => '',
'uuid' => '',
'variantOptionDefinitions' => [
'definitions' => [
[
'name' => '',
'properties' => [
[
'imageUrl' => '',
'value' => ''
]
]
]
]
],
'variants' => [
[
'barcode' => '',
'costPrice' => [
'amount' => 0,
'currencyId' => ''
],
'description' => '',
'name' => '',
'options' => [
[
'name' => '',
'value' => ''
]
],
'presentation' => [
],
'price' => [
],
'sku' => '',
'uuid' => '',
'vatPercentage' => ''
]
],
'vatPercentage' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'categories' => [
],
'category' => [
'name' => '',
'uuid' => ''
],
'createWithDefaultTax' => null,
'description' => '',
'externalReference' => '',
'imageLookupKeys' => [
],
'metadata' => [
'inPos' => null,
'source' => [
'external' => null,
'name' => ''
]
],
'name' => '',
'online' => [
'description' => '',
'presentation' => [
'additionalImageUrls' => [
],
'displayImageUrl' => '',
'mediaUrls' => [
]
],
'seo' => [
'metaDescription' => '',
'slug' => '',
'title' => ''
],
'shipping' => [
'shippingPricingModel' => '',
'weight' => [
'unit' => '',
'weight' => ''
],
'weightInGrams' => 0
],
'status' => '',
'title' => ''
],
'presentation' => [
'backgroundColor' => '',
'imageUrl' => '',
'textColor' => ''
],
'taxCode' => '',
'taxExempt' => null,
'taxRates' => [
],
'unitName' => '',
'uuid' => '',
'variantOptionDefinitions' => [
'definitions' => [
[
'name' => '',
'properties' => [
[
'imageUrl' => '',
'value' => ''
]
]
]
]
],
'variants' => [
[
'barcode' => '',
'costPrice' => [
'amount' => 0,
'currencyId' => ''
],
'description' => '',
'name' => '',
'options' => [
[
'name' => '',
'value' => ''
]
],
'presentation' => [
],
'price' => [
],
'sku' => '',
'uuid' => '',
'vatPercentage' => ''
]
],
'vatPercentage' => ''
]));
$request->setRequestUrl('{{baseUrl}}/organizations/:organizationUuid/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}}/organizations/:organizationUuid/products' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"categories": [],
"category": {
"name": "",
"uuid": ""
},
"createWithDefaultTax": false,
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"metadata": {
"inPos": false,
"source": {
"external": false,
"name": ""
}
},
"name": "",
"online": {
"description": "",
"presentation": {
"additionalImageUrls": [],
"displayImageUrl": "",
"mediaUrls": []
},
"seo": {
"metaDescription": "",
"slug": "",
"title": ""
},
"shipping": {
"shippingPricingModel": "",
"weight": {
"unit": "",
"weight": ""
},
"weightInGrams": 0
},
"status": "",
"title": ""
},
"presentation": {
"backgroundColor": "",
"imageUrl": "",
"textColor": ""
},
"taxCode": "",
"taxExempt": false,
"taxRates": [],
"unitName": "",
"uuid": "",
"variantOptionDefinitions": {
"definitions": [
{
"name": "",
"properties": [
{
"imageUrl": "",
"value": ""
}
]
}
]
},
"variants": [
{
"barcode": "",
"costPrice": {
"amount": 0,
"currencyId": ""
},
"description": "",
"name": "",
"options": [
{
"name": "",
"value": ""
}
],
"presentation": {},
"price": {},
"sku": "",
"uuid": "",
"vatPercentage": ""
}
],
"vatPercentage": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationUuid/products' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"categories": [],
"category": {
"name": "",
"uuid": ""
},
"createWithDefaultTax": false,
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"metadata": {
"inPos": false,
"source": {
"external": false,
"name": ""
}
},
"name": "",
"online": {
"description": "",
"presentation": {
"additionalImageUrls": [],
"displayImageUrl": "",
"mediaUrls": []
},
"seo": {
"metaDescription": "",
"slug": "",
"title": ""
},
"shipping": {
"shippingPricingModel": "",
"weight": {
"unit": "",
"weight": ""
},
"weightInGrams": 0
},
"status": "",
"title": ""
},
"presentation": {
"backgroundColor": "",
"imageUrl": "",
"textColor": ""
},
"taxCode": "",
"taxExempt": false,
"taxRates": [],
"unitName": "",
"uuid": "",
"variantOptionDefinitions": {
"definitions": [
{
"name": "",
"properties": [
{
"imageUrl": "",
"value": ""
}
]
}
]
},
"variants": [
{
"barcode": "",
"costPrice": {
"amount": 0,
"currencyId": ""
},
"description": "",
"name": "",
"options": [
{
"name": "",
"value": ""
}
],
"presentation": {},
"price": {},
"sku": "",
"uuid": "",
"vatPercentage": ""
}
],
"vatPercentage": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"createWithDefaultTax\": false,\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/organizations/:organizationUuid/products", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationUuid/products"
payload = {
"categories": [],
"category": {
"name": "",
"uuid": ""
},
"createWithDefaultTax": False,
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"metadata": {
"inPos": False,
"source": {
"external": False,
"name": ""
}
},
"name": "",
"online": {
"description": "",
"presentation": {
"additionalImageUrls": [],
"displayImageUrl": "",
"mediaUrls": []
},
"seo": {
"metaDescription": "",
"slug": "",
"title": ""
},
"shipping": {
"shippingPricingModel": "",
"weight": {
"unit": "",
"weight": ""
},
"weightInGrams": 0
},
"status": "",
"title": ""
},
"presentation": {
"backgroundColor": "",
"imageUrl": "",
"textColor": ""
},
"taxCode": "",
"taxExempt": False,
"taxRates": [],
"unitName": "",
"uuid": "",
"variantOptionDefinitions": { "definitions": [
{
"name": "",
"properties": [
{
"imageUrl": "",
"value": ""
}
]
}
] },
"variants": [
{
"barcode": "",
"costPrice": {
"amount": 0,
"currencyId": ""
},
"description": "",
"name": "",
"options": [
{
"name": "",
"value": ""
}
],
"presentation": {},
"price": {},
"sku": "",
"uuid": "",
"vatPercentage": ""
}
],
"vatPercentage": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationUuid/products"
payload <- "{\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"createWithDefaultTax\": false,\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\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}}/organizations/:organizationUuid/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 \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"createWithDefaultTax\": false,\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\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/organizations/:organizationUuid/products') do |req|
req.body = "{\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"createWithDefaultTax\": false,\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationUuid/products";
let payload = json!({
"categories": (),
"category": json!({
"name": "",
"uuid": ""
}),
"createWithDefaultTax": false,
"description": "",
"externalReference": "",
"imageLookupKeys": (),
"metadata": json!({
"inPos": false,
"source": json!({
"external": false,
"name": ""
})
}),
"name": "",
"online": json!({
"description": "",
"presentation": json!({
"additionalImageUrls": (),
"displayImageUrl": "",
"mediaUrls": ()
}),
"seo": json!({
"metaDescription": "",
"slug": "",
"title": ""
}),
"shipping": json!({
"shippingPricingModel": "",
"weight": json!({
"unit": "",
"weight": ""
}),
"weightInGrams": 0
}),
"status": "",
"title": ""
}),
"presentation": json!({
"backgroundColor": "",
"imageUrl": "",
"textColor": ""
}),
"taxCode": "",
"taxExempt": false,
"taxRates": (),
"unitName": "",
"uuid": "",
"variantOptionDefinitions": json!({"definitions": (
json!({
"name": "",
"properties": (
json!({
"imageUrl": "",
"value": ""
})
)
})
)}),
"variants": (
json!({
"barcode": "",
"costPrice": json!({
"amount": 0,
"currencyId": ""
}),
"description": "",
"name": "",
"options": (
json!({
"name": "",
"value": ""
})
),
"presentation": json!({}),
"price": json!({}),
"sku": "",
"uuid": "",
"vatPercentage": ""
})
),
"vatPercentage": ""
});
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}}/organizations/:organizationUuid/products \
--header 'content-type: application/json' \
--data '{
"categories": [],
"category": {
"name": "",
"uuid": ""
},
"createWithDefaultTax": false,
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"metadata": {
"inPos": false,
"source": {
"external": false,
"name": ""
}
},
"name": "",
"online": {
"description": "",
"presentation": {
"additionalImageUrls": [],
"displayImageUrl": "",
"mediaUrls": []
},
"seo": {
"metaDescription": "",
"slug": "",
"title": ""
},
"shipping": {
"shippingPricingModel": "",
"weight": {
"unit": "",
"weight": ""
},
"weightInGrams": 0
},
"status": "",
"title": ""
},
"presentation": {
"backgroundColor": "",
"imageUrl": "",
"textColor": ""
},
"taxCode": "",
"taxExempt": false,
"taxRates": [],
"unitName": "",
"uuid": "",
"variantOptionDefinitions": {
"definitions": [
{
"name": "",
"properties": [
{
"imageUrl": "",
"value": ""
}
]
}
]
},
"variants": [
{
"barcode": "",
"costPrice": {
"amount": 0,
"currencyId": ""
},
"description": "",
"name": "",
"options": [
{
"name": "",
"value": ""
}
],
"presentation": {},
"price": {},
"sku": "",
"uuid": "",
"vatPercentage": ""
}
],
"vatPercentage": ""
}'
echo '{
"categories": [],
"category": {
"name": "",
"uuid": ""
},
"createWithDefaultTax": false,
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"metadata": {
"inPos": false,
"source": {
"external": false,
"name": ""
}
},
"name": "",
"online": {
"description": "",
"presentation": {
"additionalImageUrls": [],
"displayImageUrl": "",
"mediaUrls": []
},
"seo": {
"metaDescription": "",
"slug": "",
"title": ""
},
"shipping": {
"shippingPricingModel": "",
"weight": {
"unit": "",
"weight": ""
},
"weightInGrams": 0
},
"status": "",
"title": ""
},
"presentation": {
"backgroundColor": "",
"imageUrl": "",
"textColor": ""
},
"taxCode": "",
"taxExempt": false,
"taxRates": [],
"unitName": "",
"uuid": "",
"variantOptionDefinitions": {
"definitions": [
{
"name": "",
"properties": [
{
"imageUrl": "",
"value": ""
}
]
}
]
},
"variants": [
{
"barcode": "",
"costPrice": {
"amount": 0,
"currencyId": ""
},
"description": "",
"name": "",
"options": [
{
"name": "",
"value": ""
}
],
"presentation": {},
"price": {},
"sku": "",
"uuid": "",
"vatPercentage": ""
}
],
"vatPercentage": ""
}' | \
http POST {{baseUrl}}/organizations/:organizationUuid/products \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "categories": [],\n "category": {\n "name": "",\n "uuid": ""\n },\n "createWithDefaultTax": false,\n "description": "",\n "externalReference": "",\n "imageLookupKeys": [],\n "metadata": {\n "inPos": false,\n "source": {\n "external": false,\n "name": ""\n }\n },\n "name": "",\n "online": {\n "description": "",\n "presentation": {\n "additionalImageUrls": [],\n "displayImageUrl": "",\n "mediaUrls": []\n },\n "seo": {\n "metaDescription": "",\n "slug": "",\n "title": ""\n },\n "shipping": {\n "shippingPricingModel": "",\n "weight": {\n "unit": "",\n "weight": ""\n },\n "weightInGrams": 0\n },\n "status": "",\n "title": ""\n },\n "presentation": {\n "backgroundColor": "",\n "imageUrl": "",\n "textColor": ""\n },\n "taxCode": "",\n "taxExempt": false,\n "taxRates": [],\n "unitName": "",\n "uuid": "",\n "variantOptionDefinitions": {\n "definitions": [\n {\n "name": "",\n "properties": [\n {\n "imageUrl": "",\n "value": ""\n }\n ]\n }\n ]\n },\n "variants": [\n {\n "barcode": "",\n "costPrice": {\n "amount": 0,\n "currencyId": ""\n },\n "description": "",\n "name": "",\n "options": [\n {\n "name": "",\n "value": ""\n }\n ],\n "presentation": {},\n "price": {},\n "sku": "",\n "uuid": "",\n "vatPercentage": ""\n }\n ],\n "vatPercentage": ""\n}' \
--output-document \
- {{baseUrl}}/organizations/:organizationUuid/products
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"categories": [],
"category": [
"name": "",
"uuid": ""
],
"createWithDefaultTax": false,
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"metadata": [
"inPos": false,
"source": [
"external": false,
"name": ""
]
],
"name": "",
"online": [
"description": "",
"presentation": [
"additionalImageUrls": [],
"displayImageUrl": "",
"mediaUrls": []
],
"seo": [
"metaDescription": "",
"slug": "",
"title": ""
],
"shipping": [
"shippingPricingModel": "",
"weight": [
"unit": "",
"weight": ""
],
"weightInGrams": 0
],
"status": "",
"title": ""
],
"presentation": [
"backgroundColor": "",
"imageUrl": "",
"textColor": ""
],
"taxCode": "",
"taxExempt": false,
"taxRates": [],
"unitName": "",
"uuid": "",
"variantOptionDefinitions": ["definitions": [
[
"name": "",
"properties": [
[
"imageUrl": "",
"value": ""
]
]
]
]],
"variants": [
[
"barcode": "",
"costPrice": [
"amount": 0,
"currencyId": ""
],
"description": "",
"name": "",
"options": [
[
"name": "",
"value": ""
]
],
"presentation": [],
"price": [],
"sku": "",
"uuid": "",
"vatPercentage": ""
]
],
"vatPercentage": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationUuid/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()
DELETE
Delete a list of products
{{baseUrl}}/organizations/:organizationUuid/products
QUERY PARAMS
uuid
organizationUuid
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationUuid/products?uuid=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/organizations/:organizationUuid/products" {:query-params {:uuid ""}})
require "http/client"
url = "{{baseUrl}}/organizations/:organizationUuid/products?uuid="
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}}/organizations/:organizationUuid/products?uuid="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationUuid/products?uuid=");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationUuid/products?uuid="
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/organizations/:organizationUuid/products?uuid= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/organizations/:organizationUuid/products?uuid=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationUuid/products?uuid="))
.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}}/organizations/:organizationUuid/products?uuid=")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/organizations/:organizationUuid/products?uuid=")
.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}}/organizations/:organizationUuid/products?uuid=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/organizations/:organizationUuid/products',
params: {uuid: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationUuid/products?uuid=';
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}}/organizations/:organizationUuid/products?uuid=',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationUuid/products?uuid=")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationUuid/products?uuid=',
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}}/organizations/:organizationUuid/products',
qs: {uuid: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/organizations/:organizationUuid/products');
req.query({
uuid: ''
});
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}}/organizations/:organizationUuid/products',
params: {uuid: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationUuid/products?uuid=';
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}}/organizations/:organizationUuid/products?uuid="]
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}}/organizations/:organizationUuid/products?uuid=" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationUuid/products?uuid=",
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}}/organizations/:organizationUuid/products?uuid=');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationUuid/products');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'uuid' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationUuid/products');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'uuid' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationUuid/products?uuid=' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationUuid/products?uuid=' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/organizations/:organizationUuid/products?uuid=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationUuid/products"
querystring = {"uuid":""}
response = requests.delete(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationUuid/products"
queryString <- list(uuid = "")
response <- VERB("DELETE", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationUuid/products?uuid=")
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/organizations/:organizationUuid/products') do |req|
req.params['uuid'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationUuid/products";
let querystring = [
("uuid", ""),
];
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url '{{baseUrl}}/organizations/:organizationUuid/products?uuid='
http DELETE '{{baseUrl}}/organizations/:organizationUuid/products?uuid='
wget --quiet \
--method DELETE \
--output-document \
- '{{baseUrl}}/organizations/:organizationUuid/products?uuid='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationUuid/products?uuid=")! 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()
DELETE
Delete a single product
{{baseUrl}}/organizations/:organizationUuid/products/:productUuid
QUERY PARAMS
organizationUuid
productUuid
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationUuid/products/:productUuid");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/organizations/:organizationUuid/products/:productUuid")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationUuid/products/:productUuid"
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}}/organizations/:organizationUuid/products/:productUuid"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationUuid/products/:productUuid");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationUuid/products/:productUuid"
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/organizations/:organizationUuid/products/:productUuid HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/organizations/:organizationUuid/products/:productUuid")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationUuid/products/:productUuid"))
.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}}/organizations/:organizationUuid/products/:productUuid")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/organizations/:organizationUuid/products/:productUuid")
.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}}/organizations/:organizationUuid/products/:productUuid');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/organizations/:organizationUuid/products/:productUuid'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationUuid/products/:productUuid';
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}}/organizations/:organizationUuid/products/:productUuid',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationUuid/products/:productUuid")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationUuid/products/:productUuid',
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}}/organizations/:organizationUuid/products/:productUuid'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/organizations/:organizationUuid/products/:productUuid');
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}}/organizations/:organizationUuid/products/:productUuid'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationUuid/products/:productUuid';
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}}/organizations/:organizationUuid/products/:productUuid"]
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}}/organizations/:organizationUuid/products/:productUuid" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationUuid/products/:productUuid",
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}}/organizations/:organizationUuid/products/:productUuid');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationUuid/products/:productUuid');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationUuid/products/:productUuid');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationUuid/products/:productUuid' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationUuid/products/:productUuid' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/organizations/:organizationUuid/products/:productUuid")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationUuid/products/:productUuid"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationUuid/products/:productUuid"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationUuid/products/:productUuid")
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/organizations/:organizationUuid/products/:productUuid') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationUuid/products/:productUuid";
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}}/organizations/:organizationUuid/products/:productUuid
http DELETE {{baseUrl}}/organizations/:organizationUuid/products/:productUuid
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/organizations/:organizationUuid/products/:productUuid
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationUuid/products/:productUuid")! 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
Retrieve a single product
{{baseUrl}}/organizations/:organizationUuid/products/:productUuid
QUERY PARAMS
organizationUuid
productUuid
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationUuid/products/:productUuid");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations/:organizationUuid/products/:productUuid")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationUuid/products/:productUuid"
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}}/organizations/:organizationUuid/products/:productUuid"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationUuid/products/:productUuid");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationUuid/products/:productUuid"
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/organizations/:organizationUuid/products/:productUuid HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations/:organizationUuid/products/:productUuid")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationUuid/products/:productUuid"))
.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}}/organizations/:organizationUuid/products/:productUuid")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations/:organizationUuid/products/:productUuid")
.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}}/organizations/:organizationUuid/products/:productUuid');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/organizations/:organizationUuid/products/:productUuid'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationUuid/products/:productUuid';
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}}/organizations/:organizationUuid/products/:productUuid',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationUuid/products/:productUuid")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationUuid/products/:productUuid',
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}}/organizations/:organizationUuid/products/:productUuid'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/organizations/:organizationUuid/products/:productUuid');
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}}/organizations/:organizationUuid/products/:productUuid'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationUuid/products/:productUuid';
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}}/organizations/:organizationUuid/products/:productUuid"]
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}}/organizations/:organizationUuid/products/:productUuid" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationUuid/products/:productUuid",
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}}/organizations/:organizationUuid/products/:productUuid');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationUuid/products/:productUuid');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationUuid/products/:productUuid');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationUuid/products/:productUuid' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationUuid/products/:productUuid' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations/:organizationUuid/products/:productUuid")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationUuid/products/:productUuid"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationUuid/products/:productUuid"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationUuid/products/:productUuid")
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/organizations/:organizationUuid/products/:productUuid') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationUuid/products/:productUuid";
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}}/organizations/:organizationUuid/products/:productUuid
http GET {{baseUrl}}/organizations/:organizationUuid/products/:productUuid
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations/:organizationUuid/products/:productUuid
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationUuid/products/:productUuid")! 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
Retrieve all products visible in POS – v2
{{baseUrl}}/organizations/:organizationUuid/products/v2
QUERY PARAMS
organizationUuid
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationUuid/products/v2");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations/:organizationUuid/products/v2")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationUuid/products/v2"
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}}/organizations/:organizationUuid/products/v2"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationUuid/products/v2");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationUuid/products/v2"
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/organizations/:organizationUuid/products/v2 HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations/:organizationUuid/products/v2")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationUuid/products/v2"))
.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}}/organizations/:organizationUuid/products/v2")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations/:organizationUuid/products/v2")
.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}}/organizations/:organizationUuid/products/v2');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/organizations/:organizationUuid/products/v2'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationUuid/products/v2';
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}}/organizations/:organizationUuid/products/v2',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationUuid/products/v2")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationUuid/products/v2',
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}}/organizations/:organizationUuid/products/v2'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/organizations/:organizationUuid/products/v2');
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}}/organizations/:organizationUuid/products/v2'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationUuid/products/v2';
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}}/organizations/:organizationUuid/products/v2"]
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}}/organizations/:organizationUuid/products/v2" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationUuid/products/v2",
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}}/organizations/:organizationUuid/products/v2');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationUuid/products/v2');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationUuid/products/v2');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationUuid/products/v2' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationUuid/products/v2' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations/:organizationUuid/products/v2")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationUuid/products/v2"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationUuid/products/v2"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationUuid/products/v2")
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/organizations/:organizationUuid/products/v2') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationUuid/products/v2";
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}}/organizations/:organizationUuid/products/v2
http GET {{baseUrl}}/organizations/:organizationUuid/products/v2
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations/:organizationUuid/products/v2
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationUuid/products/v2")! 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
Retrieve all products visible in POS
{{baseUrl}}/organizations/:organizationUuid/products
QUERY PARAMS
organizationUuid
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationUuid/products");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations/:organizationUuid/products")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationUuid/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}}/organizations/:organizationUuid/products"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationUuid/products");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationUuid/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/organizations/:organizationUuid/products HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations/:organizationUuid/products")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationUuid/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}}/organizations/:organizationUuid/products")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations/:organizationUuid/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}}/organizations/:organizationUuid/products');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/organizations/:organizationUuid/products'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationUuid/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}}/organizations/:organizationUuid/products',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationUuid/products")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationUuid/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}}/organizations/:organizationUuid/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}}/organizations/:organizationUuid/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}}/organizations/:organizationUuid/products'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationUuid/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}}/organizations/:organizationUuid/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}}/organizations/:organizationUuid/products" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationUuid/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}}/organizations/:organizationUuid/products');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationUuid/products');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationUuid/products');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationUuid/products' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationUuid/products' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations/:organizationUuid/products")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationUuid/products"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationUuid/products"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationUuid/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/organizations/:organizationUuid/products') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationUuid/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}}/organizations/:organizationUuid/products
http GET {{baseUrl}}/organizations/:organizationUuid/products
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations/:organizationUuid/products
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationUuid/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()
GET
Retrieve an aggregate of active Options in the library
{{baseUrl}}/organizations/:organizationUuid/products/options
QUERY PARAMS
organizationUuid
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationUuid/products/options");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations/:organizationUuid/products/options")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationUuid/products/options"
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}}/organizations/:organizationUuid/products/options"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationUuid/products/options");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationUuid/products/options"
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/organizations/:organizationUuid/products/options HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations/:organizationUuid/products/options")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationUuid/products/options"))
.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}}/organizations/:organizationUuid/products/options")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations/:organizationUuid/products/options")
.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}}/organizations/:organizationUuid/products/options');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/organizations/:organizationUuid/products/options'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationUuid/products/options';
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}}/organizations/:organizationUuid/products/options',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationUuid/products/options")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationUuid/products/options',
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}}/organizations/:organizationUuid/products/options'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/organizations/:organizationUuid/products/options');
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}}/organizations/:organizationUuid/products/options'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationUuid/products/options';
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}}/organizations/:organizationUuid/products/options"]
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}}/organizations/:organizationUuid/products/options" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationUuid/products/options",
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}}/organizations/:organizationUuid/products/options');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationUuid/products/options');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationUuid/products/options');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationUuid/products/options' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationUuid/products/options' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations/:organizationUuid/products/options")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationUuid/products/options"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationUuid/products/options"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationUuid/products/options")
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/organizations/:organizationUuid/products/options') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationUuid/products/options";
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}}/organizations/:organizationUuid/products/options
http GET {{baseUrl}}/organizations/:organizationUuid/products/options
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations/:organizationUuid/products/options
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationUuid/products/options")! 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
Retrieve the count of existing products
{{baseUrl}}/organizations/:organizationUuid/products/v2/count
QUERY PARAMS
organizationUuid
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationUuid/products/v2/count");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/organizations/:organizationUuid/products/v2/count")
require "http/client"
url = "{{baseUrl}}/organizations/:organizationUuid/products/v2/count"
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}}/organizations/:organizationUuid/products/v2/count"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/organizations/:organizationUuid/products/v2/count");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationUuid/products/v2/count"
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/organizations/:organizationUuid/products/v2/count HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/organizations/:organizationUuid/products/v2/count")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationUuid/products/v2/count"))
.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}}/organizations/:organizationUuid/products/v2/count")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/organizations/:organizationUuid/products/v2/count")
.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}}/organizations/:organizationUuid/products/v2/count');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/organizations/:organizationUuid/products/v2/count'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationUuid/products/v2/count';
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}}/organizations/:organizationUuid/products/v2/count',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationUuid/products/v2/count")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/organizations/:organizationUuid/products/v2/count',
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}}/organizations/:organizationUuid/products/v2/count'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/organizations/:organizationUuid/products/v2/count');
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}}/organizations/:organizationUuid/products/v2/count'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationUuid/products/v2/count';
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}}/organizations/:organizationUuid/products/v2/count"]
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}}/organizations/:organizationUuid/products/v2/count" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationUuid/products/v2/count",
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}}/organizations/:organizationUuid/products/v2/count');
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationUuid/products/v2/count');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/organizations/:organizationUuid/products/v2/count');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/organizations/:organizationUuid/products/v2/count' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationUuid/products/v2/count' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/organizations/:organizationUuid/products/v2/count")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationUuid/products/v2/count"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationUuid/products/v2/count"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/organizations/:organizationUuid/products/v2/count")
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/organizations/:organizationUuid/products/v2/count') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationUuid/products/v2/count";
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}}/organizations/:organizationUuid/products/v2/count
http GET {{baseUrl}}/organizations/:organizationUuid/products/v2/count
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/organizations/:organizationUuid/products/v2/count
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationUuid/products/v2/count")! 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
Update a single product
{{baseUrl}}/organizations/:organizationUuid/products/v2/:productUuid
QUERY PARAMS
organizationUuid
productUuid
BODY json
{
"categories": [],
"category": {
"name": "",
"uuid": ""
},
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"metadata": {
"inPos": false,
"source": {
"external": false,
"name": ""
}
},
"name": "",
"online": {
"description": "",
"presentation": {
"additionalImageUrls": [],
"displayImageUrl": "",
"mediaUrls": []
},
"seo": {
"metaDescription": "",
"slug": "",
"title": ""
},
"shipping": {
"shippingPricingModel": "",
"weight": {
"unit": "",
"weight": ""
},
"weightInGrams": 0
},
"status": "",
"title": ""
},
"presentation": {
"backgroundColor": "",
"imageUrl": "",
"textColor": ""
},
"taxCode": "",
"taxExempt": false,
"taxRates": [],
"unitName": "",
"uuid": "",
"variantOptionDefinitions": {
"definitions": [
{
"name": "",
"properties": [
{
"imageUrl": "",
"value": ""
}
]
}
]
},
"variants": [
{
"barcode": "",
"costPrice": {
"amount": 0,
"currencyId": ""
},
"description": "",
"name": "",
"options": [
{
"name": "",
"value": ""
}
],
"presentation": {},
"price": {},
"sku": "",
"uuid": "",
"vatPercentage": ""
}
],
"vatPercentage": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationUuid/products/v2/:productUuid");
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 \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/organizations/:organizationUuid/products/v2/:productUuid" {:content-type :json
:form-params {:categories []
:category {:name ""
:uuid ""}
:description ""
:externalReference ""
:imageLookupKeys []
:metadata {:inPos false
:source {:external false
:name ""}}
:name ""
:online {:description ""
:presentation {:additionalImageUrls []
:displayImageUrl ""
:mediaUrls []}
:seo {:metaDescription ""
:slug ""
:title ""}
:shipping {:shippingPricingModel ""
:weight {:unit ""
:weight ""}
:weightInGrams 0}
:status ""
:title ""}
:presentation {:backgroundColor ""
:imageUrl ""
:textColor ""}
:taxCode ""
:taxExempt false
:taxRates []
:unitName ""
:uuid ""
:variantOptionDefinitions {:definitions [{:name ""
:properties [{:imageUrl ""
:value ""}]}]}
:variants [{:barcode ""
:costPrice {:amount 0
:currencyId ""}
:description ""
:name ""
:options [{:name ""
:value ""}]
:presentation {}
:price {}
:sku ""
:uuid ""
:vatPercentage ""}]
:vatPercentage ""}})
require "http/client"
url = "{{baseUrl}}/organizations/:organizationUuid/products/v2/:productUuid"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\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}}/organizations/:organizationUuid/products/v2/:productUuid"),
Content = new StringContent("{\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\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}}/organizations/:organizationUuid/products/v2/:productUuid");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationUuid/products/v2/:productUuid"
payload := strings.NewReader("{\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\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/organizations/:organizationUuid/products/v2/:productUuid HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1477
{
"categories": [],
"category": {
"name": "",
"uuid": ""
},
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"metadata": {
"inPos": false,
"source": {
"external": false,
"name": ""
}
},
"name": "",
"online": {
"description": "",
"presentation": {
"additionalImageUrls": [],
"displayImageUrl": "",
"mediaUrls": []
},
"seo": {
"metaDescription": "",
"slug": "",
"title": ""
},
"shipping": {
"shippingPricingModel": "",
"weight": {
"unit": "",
"weight": ""
},
"weightInGrams": 0
},
"status": "",
"title": ""
},
"presentation": {
"backgroundColor": "",
"imageUrl": "",
"textColor": ""
},
"taxCode": "",
"taxExempt": false,
"taxRates": [],
"unitName": "",
"uuid": "",
"variantOptionDefinitions": {
"definitions": [
{
"name": "",
"properties": [
{
"imageUrl": "",
"value": ""
}
]
}
]
},
"variants": [
{
"barcode": "",
"costPrice": {
"amount": 0,
"currencyId": ""
},
"description": "",
"name": "",
"options": [
{
"name": "",
"value": ""
}
],
"presentation": {},
"price": {},
"sku": "",
"uuid": "",
"vatPercentage": ""
}
],
"vatPercentage": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/organizations/:organizationUuid/products/v2/:productUuid")
.setHeader("content-type", "application/json")
.setBody("{\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationUuid/products/v2/:productUuid"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\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 \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/organizations/:organizationUuid/products/v2/:productUuid")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/organizations/:organizationUuid/products/v2/:productUuid")
.header("content-type", "application/json")
.body("{\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\n}")
.asString();
const data = JSON.stringify({
categories: [],
category: {
name: '',
uuid: ''
},
description: '',
externalReference: '',
imageLookupKeys: [],
metadata: {
inPos: false,
source: {
external: false,
name: ''
}
},
name: '',
online: {
description: '',
presentation: {
additionalImageUrls: [],
displayImageUrl: '',
mediaUrls: []
},
seo: {
metaDescription: '',
slug: '',
title: ''
},
shipping: {
shippingPricingModel: '',
weight: {
unit: '',
weight: ''
},
weightInGrams: 0
},
status: '',
title: ''
},
presentation: {
backgroundColor: '',
imageUrl: '',
textColor: ''
},
taxCode: '',
taxExempt: false,
taxRates: [],
unitName: '',
uuid: '',
variantOptionDefinitions: {
definitions: [
{
name: '',
properties: [
{
imageUrl: '',
value: ''
}
]
}
]
},
variants: [
{
barcode: '',
costPrice: {
amount: 0,
currencyId: ''
},
description: '',
name: '',
options: [
{
name: '',
value: ''
}
],
presentation: {},
price: {},
sku: '',
uuid: '',
vatPercentage: ''
}
],
vatPercentage: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/organizations/:organizationUuid/products/v2/:productUuid');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/organizations/:organizationUuid/products/v2/:productUuid',
headers: {'content-type': 'application/json'},
data: {
categories: [],
category: {name: '', uuid: ''},
description: '',
externalReference: '',
imageLookupKeys: [],
metadata: {inPos: false, source: {external: false, name: ''}},
name: '',
online: {
description: '',
presentation: {additionalImageUrls: [], displayImageUrl: '', mediaUrls: []},
seo: {metaDescription: '', slug: '', title: ''},
shipping: {shippingPricingModel: '', weight: {unit: '', weight: ''}, weightInGrams: 0},
status: '',
title: ''
},
presentation: {backgroundColor: '', imageUrl: '', textColor: ''},
taxCode: '',
taxExempt: false,
taxRates: [],
unitName: '',
uuid: '',
variantOptionDefinitions: {definitions: [{name: '', properties: [{imageUrl: '', value: ''}]}]},
variants: [
{
barcode: '',
costPrice: {amount: 0, currencyId: ''},
description: '',
name: '',
options: [{name: '', value: ''}],
presentation: {},
price: {},
sku: '',
uuid: '',
vatPercentage: ''
}
],
vatPercentage: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationUuid/products/v2/:productUuid';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"categories":[],"category":{"name":"","uuid":""},"description":"","externalReference":"","imageLookupKeys":[],"metadata":{"inPos":false,"source":{"external":false,"name":""}},"name":"","online":{"description":"","presentation":{"additionalImageUrls":[],"displayImageUrl":"","mediaUrls":[]},"seo":{"metaDescription":"","slug":"","title":""},"shipping":{"shippingPricingModel":"","weight":{"unit":"","weight":""},"weightInGrams":0},"status":"","title":""},"presentation":{"backgroundColor":"","imageUrl":"","textColor":""},"taxCode":"","taxExempt":false,"taxRates":[],"unitName":"","uuid":"","variantOptionDefinitions":{"definitions":[{"name":"","properties":[{"imageUrl":"","value":""}]}]},"variants":[{"barcode":"","costPrice":{"amount":0,"currencyId":""},"description":"","name":"","options":[{"name":"","value":""}],"presentation":{},"price":{},"sku":"","uuid":"","vatPercentage":""}],"vatPercentage":""}'
};
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}}/organizations/:organizationUuid/products/v2/:productUuid',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "categories": [],\n "category": {\n "name": "",\n "uuid": ""\n },\n "description": "",\n "externalReference": "",\n "imageLookupKeys": [],\n "metadata": {\n "inPos": false,\n "source": {\n "external": false,\n "name": ""\n }\n },\n "name": "",\n "online": {\n "description": "",\n "presentation": {\n "additionalImageUrls": [],\n "displayImageUrl": "",\n "mediaUrls": []\n },\n "seo": {\n "metaDescription": "",\n "slug": "",\n "title": ""\n },\n "shipping": {\n "shippingPricingModel": "",\n "weight": {\n "unit": "",\n "weight": ""\n },\n "weightInGrams": 0\n },\n "status": "",\n "title": ""\n },\n "presentation": {\n "backgroundColor": "",\n "imageUrl": "",\n "textColor": ""\n },\n "taxCode": "",\n "taxExempt": false,\n "taxRates": [],\n "unitName": "",\n "uuid": "",\n "variantOptionDefinitions": {\n "definitions": [\n {\n "name": "",\n "properties": [\n {\n "imageUrl": "",\n "value": ""\n }\n ]\n }\n ]\n },\n "variants": [\n {\n "barcode": "",\n "costPrice": {\n "amount": 0,\n "currencyId": ""\n },\n "description": "",\n "name": "",\n "options": [\n {\n "name": "",\n "value": ""\n }\n ],\n "presentation": {},\n "price": {},\n "sku": "",\n "uuid": "",\n "vatPercentage": ""\n }\n ],\n "vatPercentage": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationUuid/products/v2/:productUuid")
.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/organizations/:organizationUuid/products/v2/:productUuid',
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({
categories: [],
category: {name: '', uuid: ''},
description: '',
externalReference: '',
imageLookupKeys: [],
metadata: {inPos: false, source: {external: false, name: ''}},
name: '',
online: {
description: '',
presentation: {additionalImageUrls: [], displayImageUrl: '', mediaUrls: []},
seo: {metaDescription: '', slug: '', title: ''},
shipping: {shippingPricingModel: '', weight: {unit: '', weight: ''}, weightInGrams: 0},
status: '',
title: ''
},
presentation: {backgroundColor: '', imageUrl: '', textColor: ''},
taxCode: '',
taxExempt: false,
taxRates: [],
unitName: '',
uuid: '',
variantOptionDefinitions: {definitions: [{name: '', properties: [{imageUrl: '', value: ''}]}]},
variants: [
{
barcode: '',
costPrice: {amount: 0, currencyId: ''},
description: '',
name: '',
options: [{name: '', value: ''}],
presentation: {},
price: {},
sku: '',
uuid: '',
vatPercentage: ''
}
],
vatPercentage: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/organizations/:organizationUuid/products/v2/:productUuid',
headers: {'content-type': 'application/json'},
body: {
categories: [],
category: {name: '', uuid: ''},
description: '',
externalReference: '',
imageLookupKeys: [],
metadata: {inPos: false, source: {external: false, name: ''}},
name: '',
online: {
description: '',
presentation: {additionalImageUrls: [], displayImageUrl: '', mediaUrls: []},
seo: {metaDescription: '', slug: '', title: ''},
shipping: {shippingPricingModel: '', weight: {unit: '', weight: ''}, weightInGrams: 0},
status: '',
title: ''
},
presentation: {backgroundColor: '', imageUrl: '', textColor: ''},
taxCode: '',
taxExempt: false,
taxRates: [],
unitName: '',
uuid: '',
variantOptionDefinitions: {definitions: [{name: '', properties: [{imageUrl: '', value: ''}]}]},
variants: [
{
barcode: '',
costPrice: {amount: 0, currencyId: ''},
description: '',
name: '',
options: [{name: '', value: ''}],
presentation: {},
price: {},
sku: '',
uuid: '',
vatPercentage: ''
}
],
vatPercentage: ''
},
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}}/organizations/:organizationUuid/products/v2/:productUuid');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
categories: [],
category: {
name: '',
uuid: ''
},
description: '',
externalReference: '',
imageLookupKeys: [],
metadata: {
inPos: false,
source: {
external: false,
name: ''
}
},
name: '',
online: {
description: '',
presentation: {
additionalImageUrls: [],
displayImageUrl: '',
mediaUrls: []
},
seo: {
metaDescription: '',
slug: '',
title: ''
},
shipping: {
shippingPricingModel: '',
weight: {
unit: '',
weight: ''
},
weightInGrams: 0
},
status: '',
title: ''
},
presentation: {
backgroundColor: '',
imageUrl: '',
textColor: ''
},
taxCode: '',
taxExempt: false,
taxRates: [],
unitName: '',
uuid: '',
variantOptionDefinitions: {
definitions: [
{
name: '',
properties: [
{
imageUrl: '',
value: ''
}
]
}
]
},
variants: [
{
barcode: '',
costPrice: {
amount: 0,
currencyId: ''
},
description: '',
name: '',
options: [
{
name: '',
value: ''
}
],
presentation: {},
price: {},
sku: '',
uuid: '',
vatPercentage: ''
}
],
vatPercentage: ''
});
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}}/organizations/:organizationUuid/products/v2/:productUuid',
headers: {'content-type': 'application/json'},
data: {
categories: [],
category: {name: '', uuid: ''},
description: '',
externalReference: '',
imageLookupKeys: [],
metadata: {inPos: false, source: {external: false, name: ''}},
name: '',
online: {
description: '',
presentation: {additionalImageUrls: [], displayImageUrl: '', mediaUrls: []},
seo: {metaDescription: '', slug: '', title: ''},
shipping: {shippingPricingModel: '', weight: {unit: '', weight: ''}, weightInGrams: 0},
status: '',
title: ''
},
presentation: {backgroundColor: '', imageUrl: '', textColor: ''},
taxCode: '',
taxExempt: false,
taxRates: [],
unitName: '',
uuid: '',
variantOptionDefinitions: {definitions: [{name: '', properties: [{imageUrl: '', value: ''}]}]},
variants: [
{
barcode: '',
costPrice: {amount: 0, currencyId: ''},
description: '',
name: '',
options: [{name: '', value: ''}],
presentation: {},
price: {},
sku: '',
uuid: '',
vatPercentage: ''
}
],
vatPercentage: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationUuid/products/v2/:productUuid';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"categories":[],"category":{"name":"","uuid":""},"description":"","externalReference":"","imageLookupKeys":[],"metadata":{"inPos":false,"source":{"external":false,"name":""}},"name":"","online":{"description":"","presentation":{"additionalImageUrls":[],"displayImageUrl":"","mediaUrls":[]},"seo":{"metaDescription":"","slug":"","title":""},"shipping":{"shippingPricingModel":"","weight":{"unit":"","weight":""},"weightInGrams":0},"status":"","title":""},"presentation":{"backgroundColor":"","imageUrl":"","textColor":""},"taxCode":"","taxExempt":false,"taxRates":[],"unitName":"","uuid":"","variantOptionDefinitions":{"definitions":[{"name":"","properties":[{"imageUrl":"","value":""}]}]},"variants":[{"barcode":"","costPrice":{"amount":0,"currencyId":""},"description":"","name":"","options":[{"name":"","value":""}],"presentation":{},"price":{},"sku":"","uuid":"","vatPercentage":""}],"vatPercentage":""}'
};
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 = @{ @"categories": @[ ],
@"category": @{ @"name": @"", @"uuid": @"" },
@"description": @"",
@"externalReference": @"",
@"imageLookupKeys": @[ ],
@"metadata": @{ @"inPos": @NO, @"source": @{ @"external": @NO, @"name": @"" } },
@"name": @"",
@"online": @{ @"description": @"", @"presentation": @{ @"additionalImageUrls": @[ ], @"displayImageUrl": @"", @"mediaUrls": @[ ] }, @"seo": @{ @"metaDescription": @"", @"slug": @"", @"title": @"" }, @"shipping": @{ @"shippingPricingModel": @"", @"weight": @{ @"unit": @"", @"weight": @"" }, @"weightInGrams": @0 }, @"status": @"", @"title": @"" },
@"presentation": @{ @"backgroundColor": @"", @"imageUrl": @"", @"textColor": @"" },
@"taxCode": @"",
@"taxExempt": @NO,
@"taxRates": @[ ],
@"unitName": @"",
@"uuid": @"",
@"variantOptionDefinitions": @{ @"definitions": @[ @{ @"name": @"", @"properties": @[ @{ @"imageUrl": @"", @"value": @"" } ] } ] },
@"variants": @[ @{ @"barcode": @"", @"costPrice": @{ @"amount": @0, @"currencyId": @"" }, @"description": @"", @"name": @"", @"options": @[ @{ @"name": @"", @"value": @"" } ], @"presentation": @{ }, @"price": @{ }, @"sku": @"", @"uuid": @"", @"vatPercentage": @"" } ],
@"vatPercentage": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/organizations/:organizationUuid/products/v2/:productUuid"]
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}}/organizations/:organizationUuid/products/v2/:productUuid" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationUuid/products/v2/:productUuid",
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([
'categories' => [
],
'category' => [
'name' => '',
'uuid' => ''
],
'description' => '',
'externalReference' => '',
'imageLookupKeys' => [
],
'metadata' => [
'inPos' => null,
'source' => [
'external' => null,
'name' => ''
]
],
'name' => '',
'online' => [
'description' => '',
'presentation' => [
'additionalImageUrls' => [
],
'displayImageUrl' => '',
'mediaUrls' => [
]
],
'seo' => [
'metaDescription' => '',
'slug' => '',
'title' => ''
],
'shipping' => [
'shippingPricingModel' => '',
'weight' => [
'unit' => '',
'weight' => ''
],
'weightInGrams' => 0
],
'status' => '',
'title' => ''
],
'presentation' => [
'backgroundColor' => '',
'imageUrl' => '',
'textColor' => ''
],
'taxCode' => '',
'taxExempt' => null,
'taxRates' => [
],
'unitName' => '',
'uuid' => '',
'variantOptionDefinitions' => [
'definitions' => [
[
'name' => '',
'properties' => [
[
'imageUrl' => '',
'value' => ''
]
]
]
]
],
'variants' => [
[
'barcode' => '',
'costPrice' => [
'amount' => 0,
'currencyId' => ''
],
'description' => '',
'name' => '',
'options' => [
[
'name' => '',
'value' => ''
]
],
'presentation' => [
],
'price' => [
],
'sku' => '',
'uuid' => '',
'vatPercentage' => ''
]
],
'vatPercentage' => ''
]),
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}}/organizations/:organizationUuid/products/v2/:productUuid', [
'body' => '{
"categories": [],
"category": {
"name": "",
"uuid": ""
},
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"metadata": {
"inPos": false,
"source": {
"external": false,
"name": ""
}
},
"name": "",
"online": {
"description": "",
"presentation": {
"additionalImageUrls": [],
"displayImageUrl": "",
"mediaUrls": []
},
"seo": {
"metaDescription": "",
"slug": "",
"title": ""
},
"shipping": {
"shippingPricingModel": "",
"weight": {
"unit": "",
"weight": ""
},
"weightInGrams": 0
},
"status": "",
"title": ""
},
"presentation": {
"backgroundColor": "",
"imageUrl": "",
"textColor": ""
},
"taxCode": "",
"taxExempt": false,
"taxRates": [],
"unitName": "",
"uuid": "",
"variantOptionDefinitions": {
"definitions": [
{
"name": "",
"properties": [
{
"imageUrl": "",
"value": ""
}
]
}
]
},
"variants": [
{
"barcode": "",
"costPrice": {
"amount": 0,
"currencyId": ""
},
"description": "",
"name": "",
"options": [
{
"name": "",
"value": ""
}
],
"presentation": {},
"price": {},
"sku": "",
"uuid": "",
"vatPercentage": ""
}
],
"vatPercentage": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationUuid/products/v2/:productUuid');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'categories' => [
],
'category' => [
'name' => '',
'uuid' => ''
],
'description' => '',
'externalReference' => '',
'imageLookupKeys' => [
],
'metadata' => [
'inPos' => null,
'source' => [
'external' => null,
'name' => ''
]
],
'name' => '',
'online' => [
'description' => '',
'presentation' => [
'additionalImageUrls' => [
],
'displayImageUrl' => '',
'mediaUrls' => [
]
],
'seo' => [
'metaDescription' => '',
'slug' => '',
'title' => ''
],
'shipping' => [
'shippingPricingModel' => '',
'weight' => [
'unit' => '',
'weight' => ''
],
'weightInGrams' => 0
],
'status' => '',
'title' => ''
],
'presentation' => [
'backgroundColor' => '',
'imageUrl' => '',
'textColor' => ''
],
'taxCode' => '',
'taxExempt' => null,
'taxRates' => [
],
'unitName' => '',
'uuid' => '',
'variantOptionDefinitions' => [
'definitions' => [
[
'name' => '',
'properties' => [
[
'imageUrl' => '',
'value' => ''
]
]
]
]
],
'variants' => [
[
'barcode' => '',
'costPrice' => [
'amount' => 0,
'currencyId' => ''
],
'description' => '',
'name' => '',
'options' => [
[
'name' => '',
'value' => ''
]
],
'presentation' => [
],
'price' => [
],
'sku' => '',
'uuid' => '',
'vatPercentage' => ''
]
],
'vatPercentage' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'categories' => [
],
'category' => [
'name' => '',
'uuid' => ''
],
'description' => '',
'externalReference' => '',
'imageLookupKeys' => [
],
'metadata' => [
'inPos' => null,
'source' => [
'external' => null,
'name' => ''
]
],
'name' => '',
'online' => [
'description' => '',
'presentation' => [
'additionalImageUrls' => [
],
'displayImageUrl' => '',
'mediaUrls' => [
]
],
'seo' => [
'metaDescription' => '',
'slug' => '',
'title' => ''
],
'shipping' => [
'shippingPricingModel' => '',
'weight' => [
'unit' => '',
'weight' => ''
],
'weightInGrams' => 0
],
'status' => '',
'title' => ''
],
'presentation' => [
'backgroundColor' => '',
'imageUrl' => '',
'textColor' => ''
],
'taxCode' => '',
'taxExempt' => null,
'taxRates' => [
],
'unitName' => '',
'uuid' => '',
'variantOptionDefinitions' => [
'definitions' => [
[
'name' => '',
'properties' => [
[
'imageUrl' => '',
'value' => ''
]
]
]
]
],
'variants' => [
[
'barcode' => '',
'costPrice' => [
'amount' => 0,
'currencyId' => ''
],
'description' => '',
'name' => '',
'options' => [
[
'name' => '',
'value' => ''
]
],
'presentation' => [
],
'price' => [
],
'sku' => '',
'uuid' => '',
'vatPercentage' => ''
]
],
'vatPercentage' => ''
]));
$request->setRequestUrl('{{baseUrl}}/organizations/:organizationUuid/products/v2/:productUuid');
$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}}/organizations/:organizationUuid/products/v2/:productUuid' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"categories": [],
"category": {
"name": "",
"uuid": ""
},
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"metadata": {
"inPos": false,
"source": {
"external": false,
"name": ""
}
},
"name": "",
"online": {
"description": "",
"presentation": {
"additionalImageUrls": [],
"displayImageUrl": "",
"mediaUrls": []
},
"seo": {
"metaDescription": "",
"slug": "",
"title": ""
},
"shipping": {
"shippingPricingModel": "",
"weight": {
"unit": "",
"weight": ""
},
"weightInGrams": 0
},
"status": "",
"title": ""
},
"presentation": {
"backgroundColor": "",
"imageUrl": "",
"textColor": ""
},
"taxCode": "",
"taxExempt": false,
"taxRates": [],
"unitName": "",
"uuid": "",
"variantOptionDefinitions": {
"definitions": [
{
"name": "",
"properties": [
{
"imageUrl": "",
"value": ""
}
]
}
]
},
"variants": [
{
"barcode": "",
"costPrice": {
"amount": 0,
"currencyId": ""
},
"description": "",
"name": "",
"options": [
{
"name": "",
"value": ""
}
],
"presentation": {},
"price": {},
"sku": "",
"uuid": "",
"vatPercentage": ""
}
],
"vatPercentage": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationUuid/products/v2/:productUuid' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"categories": [],
"category": {
"name": "",
"uuid": ""
},
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"metadata": {
"inPos": false,
"source": {
"external": false,
"name": ""
}
},
"name": "",
"online": {
"description": "",
"presentation": {
"additionalImageUrls": [],
"displayImageUrl": "",
"mediaUrls": []
},
"seo": {
"metaDescription": "",
"slug": "",
"title": ""
},
"shipping": {
"shippingPricingModel": "",
"weight": {
"unit": "",
"weight": ""
},
"weightInGrams": 0
},
"status": "",
"title": ""
},
"presentation": {
"backgroundColor": "",
"imageUrl": "",
"textColor": ""
},
"taxCode": "",
"taxExempt": false,
"taxRates": [],
"unitName": "",
"uuid": "",
"variantOptionDefinitions": {
"definitions": [
{
"name": "",
"properties": [
{
"imageUrl": "",
"value": ""
}
]
}
]
},
"variants": [
{
"barcode": "",
"costPrice": {
"amount": 0,
"currencyId": ""
},
"description": "",
"name": "",
"options": [
{
"name": "",
"value": ""
}
],
"presentation": {},
"price": {},
"sku": "",
"uuid": "",
"vatPercentage": ""
}
],
"vatPercentage": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/organizations/:organizationUuid/products/v2/:productUuid", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationUuid/products/v2/:productUuid"
payload = {
"categories": [],
"category": {
"name": "",
"uuid": ""
},
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"metadata": {
"inPos": False,
"source": {
"external": False,
"name": ""
}
},
"name": "",
"online": {
"description": "",
"presentation": {
"additionalImageUrls": [],
"displayImageUrl": "",
"mediaUrls": []
},
"seo": {
"metaDescription": "",
"slug": "",
"title": ""
},
"shipping": {
"shippingPricingModel": "",
"weight": {
"unit": "",
"weight": ""
},
"weightInGrams": 0
},
"status": "",
"title": ""
},
"presentation": {
"backgroundColor": "",
"imageUrl": "",
"textColor": ""
},
"taxCode": "",
"taxExempt": False,
"taxRates": [],
"unitName": "",
"uuid": "",
"variantOptionDefinitions": { "definitions": [
{
"name": "",
"properties": [
{
"imageUrl": "",
"value": ""
}
]
}
] },
"variants": [
{
"barcode": "",
"costPrice": {
"amount": 0,
"currencyId": ""
},
"description": "",
"name": "",
"options": [
{
"name": "",
"value": ""
}
],
"presentation": {},
"price": {},
"sku": "",
"uuid": "",
"vatPercentage": ""
}
],
"vatPercentage": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationUuid/products/v2/:productUuid"
payload <- "{\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\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}}/organizations/:organizationUuid/products/v2/:productUuid")
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 \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\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/organizations/:organizationUuid/products/v2/:productUuid') do |req|
req.body = "{\n \"categories\": [],\n \"category\": {\n \"name\": \"\",\n \"uuid\": \"\"\n },\n \"description\": \"\",\n \"externalReference\": \"\",\n \"imageLookupKeys\": [],\n \"metadata\": {\n \"inPos\": false,\n \"source\": {\n \"external\": false,\n \"name\": \"\"\n }\n },\n \"name\": \"\",\n \"online\": {\n \"description\": \"\",\n \"presentation\": {\n \"additionalImageUrls\": [],\n \"displayImageUrl\": \"\",\n \"mediaUrls\": []\n },\n \"seo\": {\n \"metaDescription\": \"\",\n \"slug\": \"\",\n \"title\": \"\"\n },\n \"shipping\": {\n \"shippingPricingModel\": \"\",\n \"weight\": {\n \"unit\": \"\",\n \"weight\": \"\"\n },\n \"weightInGrams\": 0\n },\n \"status\": \"\",\n \"title\": \"\"\n },\n \"presentation\": {\n \"backgroundColor\": \"\",\n \"imageUrl\": \"\",\n \"textColor\": \"\"\n },\n \"taxCode\": \"\",\n \"taxExempt\": false,\n \"taxRates\": [],\n \"unitName\": \"\",\n \"uuid\": \"\",\n \"variantOptionDefinitions\": {\n \"definitions\": [\n {\n \"name\": \"\",\n \"properties\": [\n {\n \"imageUrl\": \"\",\n \"value\": \"\"\n }\n ]\n }\n ]\n },\n \"variants\": [\n {\n \"barcode\": \"\",\n \"costPrice\": {\n \"amount\": 0,\n \"currencyId\": \"\"\n },\n \"description\": \"\",\n \"name\": \"\",\n \"options\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"presentation\": {},\n \"price\": {},\n \"sku\": \"\",\n \"uuid\": \"\",\n \"vatPercentage\": \"\"\n }\n ],\n \"vatPercentage\": \"\"\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}}/organizations/:organizationUuid/products/v2/:productUuid";
let payload = json!({
"categories": (),
"category": json!({
"name": "",
"uuid": ""
}),
"description": "",
"externalReference": "",
"imageLookupKeys": (),
"metadata": json!({
"inPos": false,
"source": json!({
"external": false,
"name": ""
})
}),
"name": "",
"online": json!({
"description": "",
"presentation": json!({
"additionalImageUrls": (),
"displayImageUrl": "",
"mediaUrls": ()
}),
"seo": json!({
"metaDescription": "",
"slug": "",
"title": ""
}),
"shipping": json!({
"shippingPricingModel": "",
"weight": json!({
"unit": "",
"weight": ""
}),
"weightInGrams": 0
}),
"status": "",
"title": ""
}),
"presentation": json!({
"backgroundColor": "",
"imageUrl": "",
"textColor": ""
}),
"taxCode": "",
"taxExempt": false,
"taxRates": (),
"unitName": "",
"uuid": "",
"variantOptionDefinitions": json!({"definitions": (
json!({
"name": "",
"properties": (
json!({
"imageUrl": "",
"value": ""
})
)
})
)}),
"variants": (
json!({
"barcode": "",
"costPrice": json!({
"amount": 0,
"currencyId": ""
}),
"description": "",
"name": "",
"options": (
json!({
"name": "",
"value": ""
})
),
"presentation": json!({}),
"price": json!({}),
"sku": "",
"uuid": "",
"vatPercentage": ""
})
),
"vatPercentage": ""
});
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}}/organizations/:organizationUuid/products/v2/:productUuid \
--header 'content-type: application/json' \
--data '{
"categories": [],
"category": {
"name": "",
"uuid": ""
},
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"metadata": {
"inPos": false,
"source": {
"external": false,
"name": ""
}
},
"name": "",
"online": {
"description": "",
"presentation": {
"additionalImageUrls": [],
"displayImageUrl": "",
"mediaUrls": []
},
"seo": {
"metaDescription": "",
"slug": "",
"title": ""
},
"shipping": {
"shippingPricingModel": "",
"weight": {
"unit": "",
"weight": ""
},
"weightInGrams": 0
},
"status": "",
"title": ""
},
"presentation": {
"backgroundColor": "",
"imageUrl": "",
"textColor": ""
},
"taxCode": "",
"taxExempt": false,
"taxRates": [],
"unitName": "",
"uuid": "",
"variantOptionDefinitions": {
"definitions": [
{
"name": "",
"properties": [
{
"imageUrl": "",
"value": ""
}
]
}
]
},
"variants": [
{
"barcode": "",
"costPrice": {
"amount": 0,
"currencyId": ""
},
"description": "",
"name": "",
"options": [
{
"name": "",
"value": ""
}
],
"presentation": {},
"price": {},
"sku": "",
"uuid": "",
"vatPercentage": ""
}
],
"vatPercentage": ""
}'
echo '{
"categories": [],
"category": {
"name": "",
"uuid": ""
},
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"metadata": {
"inPos": false,
"source": {
"external": false,
"name": ""
}
},
"name": "",
"online": {
"description": "",
"presentation": {
"additionalImageUrls": [],
"displayImageUrl": "",
"mediaUrls": []
},
"seo": {
"metaDescription": "",
"slug": "",
"title": ""
},
"shipping": {
"shippingPricingModel": "",
"weight": {
"unit": "",
"weight": ""
},
"weightInGrams": 0
},
"status": "",
"title": ""
},
"presentation": {
"backgroundColor": "",
"imageUrl": "",
"textColor": ""
},
"taxCode": "",
"taxExempt": false,
"taxRates": [],
"unitName": "",
"uuid": "",
"variantOptionDefinitions": {
"definitions": [
{
"name": "",
"properties": [
{
"imageUrl": "",
"value": ""
}
]
}
]
},
"variants": [
{
"barcode": "",
"costPrice": {
"amount": 0,
"currencyId": ""
},
"description": "",
"name": "",
"options": [
{
"name": "",
"value": ""
}
],
"presentation": {},
"price": {},
"sku": "",
"uuid": "",
"vatPercentage": ""
}
],
"vatPercentage": ""
}' | \
http PUT {{baseUrl}}/organizations/:organizationUuid/products/v2/:productUuid \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "categories": [],\n "category": {\n "name": "",\n "uuid": ""\n },\n "description": "",\n "externalReference": "",\n "imageLookupKeys": [],\n "metadata": {\n "inPos": false,\n "source": {\n "external": false,\n "name": ""\n }\n },\n "name": "",\n "online": {\n "description": "",\n "presentation": {\n "additionalImageUrls": [],\n "displayImageUrl": "",\n "mediaUrls": []\n },\n "seo": {\n "metaDescription": "",\n "slug": "",\n "title": ""\n },\n "shipping": {\n "shippingPricingModel": "",\n "weight": {\n "unit": "",\n "weight": ""\n },\n "weightInGrams": 0\n },\n "status": "",\n "title": ""\n },\n "presentation": {\n "backgroundColor": "",\n "imageUrl": "",\n "textColor": ""\n },\n "taxCode": "",\n "taxExempt": false,\n "taxRates": [],\n "unitName": "",\n "uuid": "",\n "variantOptionDefinitions": {\n "definitions": [\n {\n "name": "",\n "properties": [\n {\n "imageUrl": "",\n "value": ""\n }\n ]\n }\n ]\n },\n "variants": [\n {\n "barcode": "",\n "costPrice": {\n "amount": 0,\n "currencyId": ""\n },\n "description": "",\n "name": "",\n "options": [\n {\n "name": "",\n "value": ""\n }\n ],\n "presentation": {},\n "price": {},\n "sku": "",\n "uuid": "",\n "vatPercentage": ""\n }\n ],\n "vatPercentage": ""\n}' \
--output-document \
- {{baseUrl}}/organizations/:organizationUuid/products/v2/:productUuid
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"categories": [],
"category": [
"name": "",
"uuid": ""
],
"description": "",
"externalReference": "",
"imageLookupKeys": [],
"metadata": [
"inPos": false,
"source": [
"external": false,
"name": ""
]
],
"name": "",
"online": [
"description": "",
"presentation": [
"additionalImageUrls": [],
"displayImageUrl": "",
"mediaUrls": []
],
"seo": [
"metaDescription": "",
"slug": "",
"title": ""
],
"shipping": [
"shippingPricingModel": "",
"weight": [
"unit": "",
"weight": ""
],
"weightInGrams": 0
],
"status": "",
"title": ""
],
"presentation": [
"backgroundColor": "",
"imageUrl": "",
"textColor": ""
],
"taxCode": "",
"taxExempt": false,
"taxRates": [],
"unitName": "",
"uuid": "",
"variantOptionDefinitions": ["definitions": [
[
"name": "",
"properties": [
[
"imageUrl": "",
"value": ""
]
]
]
]],
"variants": [
[
"barcode": "",
"costPrice": [
"amount": 0,
"currencyId": ""
],
"description": "",
"name": "",
"options": [
[
"name": "",
"value": ""
]
],
"presentation": [],
"price": [],
"sku": "",
"uuid": "",
"vatPercentage": ""
]
],
"vatPercentage": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationUuid/products/v2/:productUuid")! 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
Create a product identifier
{{baseUrl}}/organizations/:organizationUuid/products/online/slug
QUERY PARAMS
organizationUuid
BODY json
{
"productName": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/organizations/:organizationUuid/products/online/slug");
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 \"productName\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/organizations/:organizationUuid/products/online/slug" {:content-type :json
:form-params {:productName ""}})
require "http/client"
url = "{{baseUrl}}/organizations/:organizationUuid/products/online/slug"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"productName\": \"\"\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}}/organizations/:organizationUuid/products/online/slug"),
Content = new StringContent("{\n \"productName\": \"\"\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}}/organizations/:organizationUuid/products/online/slug");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"productName\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/organizations/:organizationUuid/products/online/slug"
payload := strings.NewReader("{\n \"productName\": \"\"\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/organizations/:organizationUuid/products/online/slug HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 23
{
"productName": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/organizations/:organizationUuid/products/online/slug")
.setHeader("content-type", "application/json")
.setBody("{\n \"productName\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/organizations/:organizationUuid/products/online/slug"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"productName\": \"\"\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 \"productName\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/organizations/:organizationUuid/products/online/slug")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/organizations/:organizationUuid/products/online/slug")
.header("content-type", "application/json")
.body("{\n \"productName\": \"\"\n}")
.asString();
const data = JSON.stringify({
productName: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/organizations/:organizationUuid/products/online/slug');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationUuid/products/online/slug',
headers: {'content-type': 'application/json'},
data: {productName: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/organizations/:organizationUuid/products/online/slug';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"productName":""}'
};
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}}/organizations/:organizationUuid/products/online/slug',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "productName": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"productName\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/organizations/:organizationUuid/products/online/slug")
.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/organizations/:organizationUuid/products/online/slug',
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({productName: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/organizations/:organizationUuid/products/online/slug',
headers: {'content-type': 'application/json'},
body: {productName: ''},
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}}/organizations/:organizationUuid/products/online/slug');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
productName: ''
});
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}}/organizations/:organizationUuid/products/online/slug',
headers: {'content-type': 'application/json'},
data: {productName: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/organizations/:organizationUuid/products/online/slug';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"productName":""}'
};
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 = @{ @"productName": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/organizations/:organizationUuid/products/online/slug"]
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}}/organizations/:organizationUuid/products/online/slug" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"productName\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/organizations/:organizationUuid/products/online/slug",
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([
'productName' => ''
]),
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}}/organizations/:organizationUuid/products/online/slug', [
'body' => '{
"productName": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/organizations/:organizationUuid/products/online/slug');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'productName' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'productName' => ''
]));
$request->setRequestUrl('{{baseUrl}}/organizations/:organizationUuid/products/online/slug');
$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}}/organizations/:organizationUuid/products/online/slug' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"productName": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/organizations/:organizationUuid/products/online/slug' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"productName": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"productName\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/organizations/:organizationUuid/products/online/slug", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/organizations/:organizationUuid/products/online/slug"
payload = { "productName": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/organizations/:organizationUuid/products/online/slug"
payload <- "{\n \"productName\": \"\"\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}}/organizations/:organizationUuid/products/online/slug")
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 \"productName\": \"\"\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/organizations/:organizationUuid/products/online/slug') do |req|
req.body = "{\n \"productName\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/organizations/:organizationUuid/products/online/slug";
let payload = json!({"productName": ""});
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}}/organizations/:organizationUuid/products/online/slug \
--header 'content-type: application/json' \
--data '{
"productName": ""
}'
echo '{
"productName": ""
}' | \
http POST {{baseUrl}}/organizations/:organizationUuid/products/online/slug \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "productName": ""\n}' \
--output-document \
- {{baseUrl}}/organizations/:organizationUuid/products/online/slug
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["productName": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/organizations/:organizationUuid/products/online/slug")! 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
Create new tax rates
{{baseUrl}}/v1/taxes
BODY json
{
"taxRates": [
{
"default": false,
"label": "",
"percentage": "",
"uuid": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/taxes");
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 \"taxRates\": [\n {\n \"default\": false,\n \"label\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/taxes" {:content-type :json
:form-params {:taxRates [{:default false
:label ""
:percentage ""
:uuid ""}]}})
require "http/client"
url = "{{baseUrl}}/v1/taxes"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"taxRates\": [\n {\n \"default\": false,\n \"label\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\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}}/v1/taxes"),
Content = new StringContent("{\n \"taxRates\": [\n {\n \"default\": false,\n \"label\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\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}}/v1/taxes");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"taxRates\": [\n {\n \"default\": false,\n \"label\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/taxes"
payload := strings.NewReader("{\n \"taxRates\": [\n {\n \"default\": false,\n \"label\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\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/v1/taxes HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 119
{
"taxRates": [
{
"default": false,
"label": "",
"percentage": "",
"uuid": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/taxes")
.setHeader("content-type", "application/json")
.setBody("{\n \"taxRates\": [\n {\n \"default\": false,\n \"label\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/taxes"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"taxRates\": [\n {\n \"default\": false,\n \"label\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\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 \"taxRates\": [\n {\n \"default\": false,\n \"label\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/taxes")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/taxes")
.header("content-type", "application/json")
.body("{\n \"taxRates\": [\n {\n \"default\": false,\n \"label\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
taxRates: [
{
default: false,
label: '',
percentage: '',
uuid: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/taxes');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/taxes',
headers: {'content-type': 'application/json'},
data: {taxRates: [{default: false, label: '', percentage: '', uuid: ''}]}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/taxes';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"taxRates":[{"default":false,"label":"","percentage":"","uuid":""}]}'
};
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}}/v1/taxes',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "taxRates": [\n {\n "default": false,\n "label": "",\n "percentage": "",\n "uuid": ""\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 \"taxRates\": [\n {\n \"default\": false,\n \"label\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/taxes")
.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/v1/taxes',
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({taxRates: [{default: false, label: '', percentage: '', uuid: ''}]}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/taxes',
headers: {'content-type': 'application/json'},
body: {taxRates: [{default: false, label: '', percentage: '', uuid: ''}]},
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}}/v1/taxes');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
taxRates: [
{
default: false,
label: '',
percentage: '',
uuid: ''
}
]
});
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}}/v1/taxes',
headers: {'content-type': 'application/json'},
data: {taxRates: [{default: false, label: '', percentage: '', uuid: ''}]}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/taxes';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"taxRates":[{"default":false,"label":"","percentage":"","uuid":""}]}'
};
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 = @{ @"taxRates": @[ @{ @"default": @NO, @"label": @"", @"percentage": @"", @"uuid": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/taxes"]
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}}/v1/taxes" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"taxRates\": [\n {\n \"default\": false,\n \"label\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/taxes",
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([
'taxRates' => [
[
'default' => null,
'label' => '',
'percentage' => '',
'uuid' => ''
]
]
]),
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}}/v1/taxes', [
'body' => '{
"taxRates": [
{
"default": false,
"label": "",
"percentage": "",
"uuid": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/taxes');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'taxRates' => [
[
'default' => null,
'label' => '',
'percentage' => '',
'uuid' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'taxRates' => [
[
'default' => null,
'label' => '',
'percentage' => '',
'uuid' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/v1/taxes');
$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}}/v1/taxes' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"taxRates": [
{
"default": false,
"label": "",
"percentage": "",
"uuid": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/taxes' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"taxRates": [
{
"default": false,
"label": "",
"percentage": "",
"uuid": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"taxRates\": [\n {\n \"default\": false,\n \"label\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/taxes", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/taxes"
payload = { "taxRates": [
{
"default": False,
"label": "",
"percentage": "",
"uuid": ""
}
] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/taxes"
payload <- "{\n \"taxRates\": [\n {\n \"default\": false,\n \"label\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\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}}/v1/taxes")
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 \"taxRates\": [\n {\n \"default\": false,\n \"label\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\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/v1/taxes') do |req|
req.body = "{\n \"taxRates\": [\n {\n \"default\": false,\n \"label\": \"\",\n \"percentage\": \"\",\n \"uuid\": \"\"\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}}/v1/taxes";
let payload = json!({"taxRates": (
json!({
"default": false,
"label": "",
"percentage": "",
"uuid": ""
})
)});
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}}/v1/taxes \
--header 'content-type: application/json' \
--data '{
"taxRates": [
{
"default": false,
"label": "",
"percentage": "",
"uuid": ""
}
]
}'
echo '{
"taxRates": [
{
"default": false,
"label": "",
"percentage": "",
"uuid": ""
}
]
}' | \
http POST {{baseUrl}}/v1/taxes \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "taxRates": [\n {\n "default": false,\n "label": "",\n "percentage": "",\n "uuid": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/v1/taxes
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["taxRates": [
[
"default": false,
"label": "",
"percentage": "",
"uuid": ""
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/taxes")! 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
Delete a single tax rate
{{baseUrl}}/v1/taxes/:taxRateUuid
QUERY PARAMS
taxRateUuid
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/taxes/:taxRateUuid");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/v1/taxes/:taxRateUuid")
require "http/client"
url = "{{baseUrl}}/v1/taxes/:taxRateUuid"
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}}/v1/taxes/:taxRateUuid"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/taxes/:taxRateUuid");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/taxes/:taxRateUuid"
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/v1/taxes/:taxRateUuid HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/v1/taxes/:taxRateUuid")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/taxes/:taxRateUuid"))
.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}}/v1/taxes/:taxRateUuid")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/v1/taxes/:taxRateUuid")
.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}}/v1/taxes/:taxRateUuid');
xhr.send(data);
import axios from 'axios';
const options = {method: 'DELETE', url: '{{baseUrl}}/v1/taxes/:taxRateUuid'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/taxes/:taxRateUuid';
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}}/v1/taxes/:taxRateUuid',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/taxes/:taxRateUuid")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/taxes/:taxRateUuid',
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}}/v1/taxes/:taxRateUuid'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/v1/taxes/:taxRateUuid');
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}}/v1/taxes/:taxRateUuid'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/taxes/:taxRateUuid';
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}}/v1/taxes/:taxRateUuid"]
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}}/v1/taxes/:taxRateUuid" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/taxes/:taxRateUuid",
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}}/v1/taxes/:taxRateUuid');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/taxes/:taxRateUuid');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/taxes/:taxRateUuid');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/taxes/:taxRateUuid' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/taxes/:taxRateUuid' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/v1/taxes/:taxRateUuid")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/taxes/:taxRateUuid"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/taxes/:taxRateUuid"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/taxes/:taxRateUuid")
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/v1/taxes/:taxRateUuid') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/taxes/:taxRateUuid";
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}}/v1/taxes/:taxRateUuid
http DELETE {{baseUrl}}/v1/taxes/:taxRateUuid
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/v1/taxes/:taxRateUuid
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/taxes/:taxRateUuid")! 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
Get a single tax rate
{{baseUrl}}/v1/taxes/:taxRateUuid
QUERY PARAMS
taxRateUuid
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/taxes/:taxRateUuid");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1/taxes/:taxRateUuid")
require "http/client"
url = "{{baseUrl}}/v1/taxes/:taxRateUuid"
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}}/v1/taxes/:taxRateUuid"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/taxes/:taxRateUuid");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/taxes/:taxRateUuid"
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/v1/taxes/:taxRateUuid HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1/taxes/:taxRateUuid")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/taxes/:taxRateUuid"))
.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}}/v1/taxes/:taxRateUuid")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1/taxes/:taxRateUuid")
.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}}/v1/taxes/:taxRateUuid');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v1/taxes/:taxRateUuid'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/taxes/:taxRateUuid';
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}}/v1/taxes/:taxRateUuid',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/taxes/:taxRateUuid")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/taxes/:taxRateUuid',
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}}/v1/taxes/:taxRateUuid'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1/taxes/:taxRateUuid');
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}}/v1/taxes/:taxRateUuid'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/taxes/:taxRateUuid';
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}}/v1/taxes/:taxRateUuid"]
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}}/v1/taxes/:taxRateUuid" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/taxes/:taxRateUuid",
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}}/v1/taxes/:taxRateUuid');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/taxes/:taxRateUuid');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/taxes/:taxRateUuid');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/taxes/:taxRateUuid' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/taxes/:taxRateUuid' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1/taxes/:taxRateUuid")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/taxes/:taxRateUuid"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/taxes/:taxRateUuid"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/taxes/:taxRateUuid")
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/v1/taxes/:taxRateUuid') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/taxes/:taxRateUuid";
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}}/v1/taxes/:taxRateUuid
http GET {{baseUrl}}/v1/taxes/:taxRateUuid
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1/taxes/:taxRateUuid
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/taxes/:taxRateUuid")! 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
Get all available tax rates
{{baseUrl}}/v1/taxes
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/taxes");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1/taxes")
require "http/client"
url = "{{baseUrl}}/v1/taxes"
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}}/v1/taxes"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/taxes");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/taxes"
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/v1/taxes HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1/taxes")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/taxes"))
.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}}/v1/taxes")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1/taxes")
.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}}/v1/taxes');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v1/taxes'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/taxes';
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}}/v1/taxes',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/taxes")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/taxes',
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}}/v1/taxes'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1/taxes');
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}}/v1/taxes'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/taxes';
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}}/v1/taxes"]
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}}/v1/taxes" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/taxes",
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}}/v1/taxes');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/taxes');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/taxes');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/taxes' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/taxes' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1/taxes")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/taxes"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/taxes"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/taxes")
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/v1/taxes') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/taxes";
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}}/v1/taxes
http GET {{baseUrl}}/v1/taxes
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1/taxes
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/taxes")! 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
Get all tax rates and a count of products associated with each
{{baseUrl}}/v1/taxes/count
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/taxes/count");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1/taxes/count")
require "http/client"
url = "{{baseUrl}}/v1/taxes/count"
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}}/v1/taxes/count"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/taxes/count");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/taxes/count"
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/v1/taxes/count HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1/taxes/count")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/taxes/count"))
.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}}/v1/taxes/count")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1/taxes/count")
.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}}/v1/taxes/count');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v1/taxes/count'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/taxes/count';
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}}/v1/taxes/count',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/taxes/count")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/taxes/count',
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}}/v1/taxes/count'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1/taxes/count');
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}}/v1/taxes/count'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/taxes/count';
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}}/v1/taxes/count"]
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}}/v1/taxes/count" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/taxes/count",
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}}/v1/taxes/count');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/taxes/count');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/taxes/count');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/taxes/count' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/taxes/count' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1/taxes/count")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/taxes/count"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/taxes/count"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/taxes/count")
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/v1/taxes/count') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/taxes/count";
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}}/v1/taxes/count
http GET {{baseUrl}}/v1/taxes/count
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1/taxes/count
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/taxes/count")! 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
Get the organization tax settings
{{baseUrl}}/v1/taxes/settings
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/taxes/settings");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1/taxes/settings")
require "http/client"
url = "{{baseUrl}}/v1/taxes/settings"
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}}/v1/taxes/settings"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/taxes/settings");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/taxes/settings"
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/v1/taxes/settings HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1/taxes/settings")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/taxes/settings"))
.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}}/v1/taxes/settings")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1/taxes/settings")
.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}}/v1/taxes/settings');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v1/taxes/settings'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/taxes/settings';
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}}/v1/taxes/settings',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/taxes/settings")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/taxes/settings',
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}}/v1/taxes/settings'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1/taxes/settings');
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}}/v1/taxes/settings'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/taxes/settings';
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}}/v1/taxes/settings"]
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}}/v1/taxes/settings" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/taxes/settings",
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}}/v1/taxes/settings');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/taxes/settings');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/taxes/settings');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/taxes/settings' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/taxes/settings' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1/taxes/settings")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/taxes/settings"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/taxes/settings"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/taxes/settings")
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/v1/taxes/settings') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/taxes/settings";
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}}/v1/taxes/settings
http GET {{baseUrl}}/v1/taxes/settings
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1/taxes/settings
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/taxes/settings")! 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
Update a single tax rate
{{baseUrl}}/v1/taxes/:taxRateUuid
QUERY PARAMS
taxRateUuid
BODY json
{
"default": false,
"label": "",
"percentage": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/taxes/:taxRateUuid");
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 \"default\": false,\n \"label\": \"\",\n \"percentage\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/v1/taxes/:taxRateUuid" {:content-type :json
:form-params {:default false
:label ""
:percentage ""}})
require "http/client"
url = "{{baseUrl}}/v1/taxes/:taxRateUuid"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"default\": false,\n \"label\": \"\",\n \"percentage\": \"\"\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}}/v1/taxes/:taxRateUuid"),
Content = new StringContent("{\n \"default\": false,\n \"label\": \"\",\n \"percentage\": \"\"\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}}/v1/taxes/:taxRateUuid");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"default\": false,\n \"label\": \"\",\n \"percentage\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/taxes/:taxRateUuid"
payload := strings.NewReader("{\n \"default\": false,\n \"label\": \"\",\n \"percentage\": \"\"\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/v1/taxes/:taxRateUuid HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 57
{
"default": false,
"label": "",
"percentage": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/v1/taxes/:taxRateUuid")
.setHeader("content-type", "application/json")
.setBody("{\n \"default\": false,\n \"label\": \"\",\n \"percentage\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/taxes/:taxRateUuid"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"default\": false,\n \"label\": \"\",\n \"percentage\": \"\"\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 \"default\": false,\n \"label\": \"\",\n \"percentage\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/taxes/:taxRateUuid")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/v1/taxes/:taxRateUuid")
.header("content-type", "application/json")
.body("{\n \"default\": false,\n \"label\": \"\",\n \"percentage\": \"\"\n}")
.asString();
const data = JSON.stringify({
default: false,
label: '',
percentage: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/v1/taxes/:taxRateUuid');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/v1/taxes/:taxRateUuid',
headers: {'content-type': 'application/json'},
data: {default: false, label: '', percentage: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/taxes/:taxRateUuid';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"default":false,"label":"","percentage":""}'
};
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}}/v1/taxes/:taxRateUuid',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "default": false,\n "label": "",\n "percentage": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"default\": false,\n \"label\": \"\",\n \"percentage\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/taxes/:taxRateUuid")
.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/v1/taxes/:taxRateUuid',
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({default: false, label: '', percentage: ''}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/v1/taxes/:taxRateUuid',
headers: {'content-type': 'application/json'},
body: {default: false, label: '', percentage: ''},
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}}/v1/taxes/:taxRateUuid');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
default: false,
label: '',
percentage: ''
});
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}}/v1/taxes/:taxRateUuid',
headers: {'content-type': 'application/json'},
data: {default: false, label: '', percentage: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/taxes/:taxRateUuid';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"default":false,"label":"","percentage":""}'
};
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 = @{ @"default": @NO,
@"label": @"",
@"percentage": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/taxes/:taxRateUuid"]
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}}/v1/taxes/:taxRateUuid" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"default\": false,\n \"label\": \"\",\n \"percentage\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/taxes/:taxRateUuid",
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([
'default' => null,
'label' => '',
'percentage' => ''
]),
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}}/v1/taxes/:taxRateUuid', [
'body' => '{
"default": false,
"label": "",
"percentage": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/taxes/:taxRateUuid');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'default' => null,
'label' => '',
'percentage' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'default' => null,
'label' => '',
'percentage' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/taxes/:taxRateUuid');
$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}}/v1/taxes/:taxRateUuid' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"default": false,
"label": "",
"percentage": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/taxes/:taxRateUuid' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"default": false,
"label": "",
"percentage": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"default\": false,\n \"label\": \"\",\n \"percentage\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/v1/taxes/:taxRateUuid", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/taxes/:taxRateUuid"
payload = {
"default": False,
"label": "",
"percentage": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/taxes/:taxRateUuid"
payload <- "{\n \"default\": false,\n \"label\": \"\",\n \"percentage\": \"\"\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}}/v1/taxes/:taxRateUuid")
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 \"default\": false,\n \"label\": \"\",\n \"percentage\": \"\"\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/v1/taxes/:taxRateUuid') do |req|
req.body = "{\n \"default\": false,\n \"label\": \"\",\n \"percentage\": \"\"\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}}/v1/taxes/:taxRateUuid";
let payload = json!({
"default": false,
"label": "",
"percentage": ""
});
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}}/v1/taxes/:taxRateUuid \
--header 'content-type: application/json' \
--data '{
"default": false,
"label": "",
"percentage": ""
}'
echo '{
"default": false,
"label": "",
"percentage": ""
}' | \
http PUT {{baseUrl}}/v1/taxes/:taxRateUuid \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "default": false,\n "label": "",\n "percentage": ""\n}' \
--output-document \
- {{baseUrl}}/v1/taxes/:taxRateUuid
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"default": false,
"label": "",
"percentage": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/taxes/:taxRateUuid")! 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()
PUT
Update the organization tax settings
{{baseUrl}}/v1/taxes/settings
BODY json
{
"taxationMode": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/taxes/settings");
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 \"taxationMode\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/v1/taxes/settings" {:content-type :json
:form-params {:taxationMode ""}})
require "http/client"
url = "{{baseUrl}}/v1/taxes/settings"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"taxationMode\": \"\"\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}}/v1/taxes/settings"),
Content = new StringContent("{\n \"taxationMode\": \"\"\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}}/v1/taxes/settings");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"taxationMode\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/taxes/settings"
payload := strings.NewReader("{\n \"taxationMode\": \"\"\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/v1/taxes/settings HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 24
{
"taxationMode": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/v1/taxes/settings")
.setHeader("content-type", "application/json")
.setBody("{\n \"taxationMode\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/taxes/settings"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"taxationMode\": \"\"\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 \"taxationMode\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/taxes/settings")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/v1/taxes/settings")
.header("content-type", "application/json")
.body("{\n \"taxationMode\": \"\"\n}")
.asString();
const data = JSON.stringify({
taxationMode: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/v1/taxes/settings');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/v1/taxes/settings',
headers: {'content-type': 'application/json'},
data: {taxationMode: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/taxes/settings';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"taxationMode":""}'
};
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}}/v1/taxes/settings',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "taxationMode": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"taxationMode\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/taxes/settings")
.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/v1/taxes/settings',
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({taxationMode: ''}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/v1/taxes/settings',
headers: {'content-type': 'application/json'},
body: {taxationMode: ''},
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}}/v1/taxes/settings');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
taxationMode: ''
});
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}}/v1/taxes/settings',
headers: {'content-type': 'application/json'},
data: {taxationMode: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/taxes/settings';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"taxationMode":""}'
};
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 = @{ @"taxationMode": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/taxes/settings"]
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}}/v1/taxes/settings" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"taxationMode\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/taxes/settings",
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([
'taxationMode' => ''
]),
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}}/v1/taxes/settings', [
'body' => '{
"taxationMode": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/taxes/settings');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'taxationMode' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'taxationMode' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/taxes/settings');
$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}}/v1/taxes/settings' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"taxationMode": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/taxes/settings' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"taxationMode": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"taxationMode\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/v1/taxes/settings", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/taxes/settings"
payload = { "taxationMode": "" }
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/taxes/settings"
payload <- "{\n \"taxationMode\": \"\"\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}}/v1/taxes/settings")
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 \"taxationMode\": \"\"\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/v1/taxes/settings') do |req|
req.body = "{\n \"taxationMode\": \"\"\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}}/v1/taxes/settings";
let payload = json!({"taxationMode": ""});
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}}/v1/taxes/settings \
--header 'content-type: application/json' \
--data '{
"taxationMode": ""
}'
echo '{
"taxationMode": ""
}' | \
http PUT {{baseUrl}}/v1/taxes/settings \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "taxationMode": ""\n}' \
--output-document \
- {{baseUrl}}/v1/taxes/settings
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["taxationMode": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/taxes/settings")! 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()