Convert a retailer-sourced product to a partner product
curl --request POST \
--url http://localhost:3000/v1/admin/partners/products/{id}/convert \
--header 'Content-Type: application/json' \
--data '
{
"partner_brand_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"selling_price": 1,
"commission_rate": 0.5,
"partner_pricing_model": "consignment",
"partner_wholesale_price": 1,
"category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"subcategory_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "http://localhost:3000/v1/admin/partners/products/{id}/convert"
payload = {
"partner_brand_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"selling_price": 1,
"commission_rate": 0.5,
"partner_pricing_model": "consignment",
"partner_wholesale_price": 1,
"category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"subcategory_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
partner_brand_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
selling_price: 1,
commission_rate: 0.5,
partner_pricing_model: 'consignment',
partner_wholesale_price: 1,
category_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
subcategory_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('http://localhost:3000/v1/admin/partners/products/{id}/convert', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/v1/admin/partners/products/{id}/convert",
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([
'partner_brand_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'selling_price' => 1,
'commission_rate' => 0.5,
'partner_pricing_model' => 'consignment',
'partner_wholesale_price' => 1,
'category_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'subcategory_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:3000/v1/admin/partners/products/{id}/convert"
payload := strings.NewReader("{\n \"partner_brand_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"selling_price\": 1,\n \"commission_rate\": 0.5,\n \"partner_pricing_model\": \"consignment\",\n \"partner_wholesale_price\": 1,\n \"category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"subcategory_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:3000/v1/admin/partners/products/{id}/convert")
.header("Content-Type", "application/json")
.body("{\n \"partner_brand_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"selling_price\": 1,\n \"commission_rate\": 0.5,\n \"partner_pricing_model\": \"consignment\",\n \"partner_wholesale_price\": 1,\n \"category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"subcategory_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/v1/admin/partners/products/{id}/convert")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"partner_brand_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"selling_price\": 1,\n \"commission_rate\": 0.5,\n \"partner_pricing_model\": \"consignment\",\n \"partner_wholesale_price\": 1,\n \"category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"subcategory_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"sellable_product": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"taxonomy_id": "<string>",
"name": "<string>",
"is_active": true,
"commission_rate": 123,
"partner_pricing_model": "<string>",
"partner_wholesale_price": 123
}
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Admin - Partner Products
Convert a retailer-sourced product to a partner product
Converts a product from retailer-sourced to partner-supplied. Sets partner ownership, deactivates retailer mappings and pricing.
POST
/
v1
/
admin
/
partners
/
products
/
{id}
/
convert
Convert a retailer-sourced product to a partner product
curl --request POST \
--url http://localhost:3000/v1/admin/partners/products/{id}/convert \
--header 'Content-Type: application/json' \
--data '
{
"partner_brand_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"selling_price": 1,
"commission_rate": 0.5,
"partner_pricing_model": "consignment",
"partner_wholesale_price": 1,
"category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"subcategory_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "http://localhost:3000/v1/admin/partners/products/{id}/convert"
payload = {
"partner_brand_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"selling_price": 1,
"commission_rate": 0.5,
"partner_pricing_model": "consignment",
"partner_wholesale_price": 1,
"category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"subcategory_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
partner_brand_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
selling_price: 1,
commission_rate: 0.5,
partner_pricing_model: 'consignment',
partner_wholesale_price: 1,
category_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
subcategory_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('http://localhost:3000/v1/admin/partners/products/{id}/convert', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/v1/admin/partners/products/{id}/convert",
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([
'partner_brand_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'selling_price' => 1,
'commission_rate' => 0.5,
'partner_pricing_model' => 'consignment',
'partner_wholesale_price' => 1,
'category_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'subcategory_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:3000/v1/admin/partners/products/{id}/convert"
payload := strings.NewReader("{\n \"partner_brand_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"selling_price\": 1,\n \"commission_rate\": 0.5,\n \"partner_pricing_model\": \"consignment\",\n \"partner_wholesale_price\": 1,\n \"category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"subcategory_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:3000/v1/admin/partners/products/{id}/convert")
.header("Content-Type", "application/json")
.body("{\n \"partner_brand_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"selling_price\": 1,\n \"commission_rate\": 0.5,\n \"partner_pricing_model\": \"consignment\",\n \"partner_wholesale_price\": 1,\n \"category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"subcategory_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/v1/admin/partners/products/{id}/convert")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"partner_brand_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"selling_price\": 1,\n \"commission_rate\": 0.5,\n \"partner_pricing_model\": \"consignment\",\n \"partner_wholesale_price\": 1,\n \"category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"subcategory_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"sellable_product": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"taxonomy_id": "<string>",
"name": "<string>",
"is_active": true,
"commission_rate": 123,
"partner_pricing_model": "<string>",
"partner_wholesale_price": 123
}
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Path Parameters
Body
application/json
Required range:
x > 0Required range:
0 <= x <= 1Available options:
consignment, wholesale Required range:
x > 0Available options:
ambient, chilled, frozen ⌘I