Add an option to a Package
curl --request POST \
--url https://api.example.com/{supplierapi}/package/{productPricesDetailId}/optionimport requests
url = "https://api.example.com/{supplierapi}/package/{productPricesDetailId}/option"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/{supplierapi}/package/{productPricesDetailId}/option', 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",
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"
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")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/{supplierapi}/package/{productPricesDetailId}/option")
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
Add an option to a Package
Add an option to a Package
Adds an option to the Package based on the JSON array of data provided.
Response
Top Level Result Object
| Field name | Nullable | Type | Description |
|---|---|---|---|
| optionId | n | Integer | ID of the newly created Package Option. |
POST
/
{supplierapi}
/
package
/
{productPricesDetailId}
/
option
Add an option to a Package
curl --request POST \
--url https://api.example.com/{supplierapi}/package/{productPricesDetailId}/optionimport requests
url = "https://api.example.com/{supplierapi}/package/{productPricesDetailId}/option"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/{supplierapi}/package/{productPricesDetailId}/option', 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",
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"
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")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/{supplierapi}/package/{productPricesDetailId}/option")
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
The ID of the ProductPricesDetail
Pattern:
supplier|apiv1/supplierQuery Parameters
Label for the Package Option.
Sort ordering for the Package Option. The ordering for other Options will be adjusted as necessary to accommodate the new Option's ordering.
Response
Returned when successful.