Create a draft version of the product price
curl --request POST \
--url https://api.example.com/{supplierapi}/product/{productId}/price/{productPricesDetailsId}/makedraftimport requests
url = "https://api.example.com/{supplierapi}/product/{productId}/price/{productPricesDetailsId}/makedraft"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/{supplierapi}/product/{productId}/price/{productPricesDetailsId}/makedraft', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/{supplierapi}/product/{productId}/price/{productPricesDetailsId}/makedraft",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/{supplierapi}/product/{productId}/price/{productPricesDetailsId}/makedraft"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/{supplierapi}/product/{productId}/price/{productPricesDetailsId}/makedraft")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/{supplierapi}/product/{productId}/price/{productPricesDetailsId}/makedraft")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyVersion 1
Create a draft version of the product price
## Create a draft version of the product price ##
<p>
Creates a draft version of the product price which can be used to make further edits. While the main route to
PUT changes to a product price will automatically create a new draft when necessary and return the new ID,
some other routes (e.g. to manage package options) do not.
</p>
<p>
The exact behaviour depends on the current status of the product prices detail passed in: <ul>
<li>If it's already in Draft state no action will be taken</li>
<li>If it's in Candidate or Approved state, it will be reverted to Draft state</li>
<li>If it's in Live or History state, a duplicate Draft version of the price will be created</li>
<li>If it's in Delete Pending or Delete Approved state, an 422 error will be returned</li>
</ul>
</p>
POST
/
{supplierapi}
/
product
/
{productId}
/
price
/
{productPricesDetailsId}
/
makedraft
Create a draft version of the product price
curl --request POST \
--url https://api.example.com/{supplierapi}/product/{productId}/price/{productPricesDetailsId}/makedraftimport requests
url = "https://api.example.com/{supplierapi}/product/{productId}/price/{productPricesDetailsId}/makedraft"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/{supplierapi}/product/{productId}/price/{productPricesDetailsId}/makedraft', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/{supplierapi}/product/{productId}/price/{productPricesDetailsId}/makedraft",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/{supplierapi}/product/{productId}/price/{productPricesDetailsId}/makedraft"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/{supplierapi}/product/{productId}/price/{productPricesDetailsId}/makedraft")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/{supplierapi}/product/{productId}/price/{productPricesDetailsId}/makedraft")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body