Adds a product to a Package Option
curl --request POST \
--url https://api.example.com/{supplierapi}/package/{productPricesDetailId}/option/{optionId}/productimport requests
url = "https://api.example.com/{supplierapi}/package/{productPricesDetailId}/option/{optionId}/product"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/{supplierapi}/package/{productPricesDetailId}/option/{optionId}/product', 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}/package/{productPricesDetailId}/option/{optionId}/product",
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}/package/{productPricesDetailId}/option/{optionId}/product"
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}/package/{productPricesDetailId}/option/{optionId}/product")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/{supplierapi}/package/{productPricesDetailId}/option/{optionId}/product")
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_bodyPackages
Adds a product to a Package Option
Adds a product to a Package Option
Adds a product to the given Package Option.
Response
201 on success
Top Level Result Object
| Field name | Nullable | Type | Description |
|---|---|---|---|
| packageProductId | n | Integer | ID of the newly created Package Product. |
POST
/
{supplierapi}
/
package
/
{productPricesDetailId}
/
option
/
{optionId}
/
product
Adds a product to a Package Option
curl --request POST \
--url https://api.example.com/{supplierapi}/package/{productPricesDetailId}/option/{optionId}/productimport requests
url = "https://api.example.com/{supplierapi}/package/{productPricesDetailId}/option/{optionId}/product"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/{supplierapi}/package/{productPricesDetailId}/option/{optionId}/product', 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}/package/{productPricesDetailId}/option/{optionId}/product",
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}/package/{productPricesDetailId}/option/{optionId}/product"
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}/package/{productPricesDetailId}/option/{optionId}/product")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/{supplierapi}/package/{productPricesDetailId}/option/{optionId}/product")
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_bodyPath Parameters
ProductPricesDetail to be linked to the PackageProduct.
The ID of the Package Option
Pattern:
supplier|apiv1/supplierQuery Parameters
Quantity of the ProductPricesDetail to be included. Defaults to 1.
Sort ordering for the PackageProduct. The ordering for other PackageProducts will be adjusted as necessary to accommodate the new PackageProduct's ordering.
Amount to add onto package's base RRP if this Package Product is selected. If null, the difference between the RRP for this product and the RRP for the cheapest product in the option will be used. Must be null for the cheapest product in this package option.
Response
Returned when successful.