Get price information for given customer group and product quantity. Graduated- and customer group prices are included in the response
GET https://gambio-shop.de/shop1/api.php/v2/products/{product_id}/product_prices/customer_groups/{customer_group_id}/{quantity}
Parameter name | Value | Description | Additional |
---|---|---|---|
product_id | int64 | The product id |
Required |
customer_group_id | int64 | The customer group id |
Required |
quantity | float | Products quantity |
Required |
In order to provide the authentication, you must insert the Basic Auth inside the HTTP header. The Basic Auth
is an encrypted base64 string that holds the following content: admin@shop.de:12345
where the structure is
as follows: username:password
.
An example header would look as follows:
Authorization: Basic YWRtaW5Ac2hvcC5kZToxMjM0NQ==
This request requires the use of one of following authorisation methods:
BASIC
.
The following HTTP status codes may be returned, optionally with a response resource.
Status code | Description | Resource |
---|---|---|
200 | OK Upon success, returns price information for the given customer group and quantity |
GXProductQuantityPrice |
400 | Bad Request (Missing or invalid id) |
|
404 | Not Found (Product not found) |
defaultErrorResponse |
Here are some example implementations for this operation.
Request request = new Request.Builder() .url("https://gambio-shop.de/shop1/api.php/v2/products/{product_id}/product_prices/customer_groups/%7Bcustomer_group_id%7D/%7Bquantity%7D") .get() .addHeader("content-type", "application/json") .addHeader("authorization", "Basic REPLACE_BASIC_AUTH") .build();
Response response = client.newCall(request).execute();
var options = { "method": "GET", "hostname": "gambio-shop.de", "port": null, "path": "/shop1/api.php/v2/products/{product_id}/product_prices/customer_groups/%7Bcustomer_group_id%7D/%7Bquantity%7D", "headers": {
"content-type": "application/json",
"authorization": "Basic REPLACE_BASIC_AUTH"
} };
var req = http.request(options, function (res) { var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
}); });
req.end();
var options = { method: 'GET', url: 'https://gambio-shop.de/shop1/api.php/v2/products/{product_id}/product_prices/customer_groups/%7Bcustomer_group_id%7D/%7Bquantity%7D', headers: { authorization: 'Basic REPLACE_BASIC_AUTH',
'content-type': 'application/json' } };
request(options, function (error, response, body) { if (error) throw new Error(error);
console.log(body); });
var req = unirest("GET", "https://gambio-shop.de/shop1/api.php/v2/products/{product_id}/product_prices/customer_groups/%7Bcustomer_group_id%7D/%7Bquantity%7D");
req.headers({ "authorization": "Basic REPLACE_BASIC_AUTH", "content-type": "application/json" });
req.end(function (res) { if (res.error) throw new Error(res.error);
console.log(res.body); });
var xhr = new XMLHttpRequest(); xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () { if (this.readyState === this.DONE) {
console.log(this.responseText);
} });
xhr.open("GET", "https://gambio-shop.de/shop1/api.php/v2/products/{product_id}/product_prices/customer_groups/%7Bcustomer_group_id%7D/%7Bquantity%7D"); xhr.setRequestHeader("content-type", "application/json"); xhr.setRequestHeader("authorization", "Basic REPLACE_BASIC_AUTH");
xhr.send(data);
"content-type": "application/json",
"authorization": "Basic REPLACE_BASIC_AUTH"
} }
$.ajax(settings).done(function (response) { console.log(response); });
$curl = curl_init();
curl_setopt_array($curl, array( CURLOPT_URL => "https://gambio-shop.de/shop1/api.php/v2/products/{product_id}/product_prices/customer_groups/%7Bcustomer_group_id%7D/%7Bquantity%7D", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array(
"authorization: Basic REPLACE_BASIC_AUTH",
"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 = new HttpRequest(); $request->setUrl('https://gambio-shop.de/shop1/api.php/v2/products/{product_id}/product_prices/customer_groups/%7Bcustomer_group_id%7D/%7Bquantity%7D'); $request->setMethod(HTTP_METH_GET);
$request->setHeaders(array( 'authorization' => 'Basic REPLACE_BASIC_AUTH', 'content-type' => 'application/json' ));
try { $response = $request->send();
echo $response->getBody(); } catch (HttpException $ex) { echo $ex; }
$client = new http\Client; $request = new http\Client\Request;
$request->setRequestUrl('https://gambio-shop.de/shop1/api.php/v2/products/{product_id}/product_prices/customer_groups/%7Bcustomer_group_id%7D/%7Bquantity%7D'); $request->setRequestMethod('GET'); $request->setHeaders(array( 'authorization' => 'Basic REPLACE_BASIC_AUTH', 'content-type' => 'application/json' ));
$client->enqueue($request)->send(); $response = $client->getResponse();
echo $response->getBody();
conn = http.client.HTTPSConnection("gambio-shop.de")
headers = {
'content-type': "application/json",
'authorization': "Basic REPLACE_BASIC_AUTH"
}
conn.request("GET", "/shop1/api.php/v2/products/{product_id}/product_prices/customer_groups/%7Bcustomer_group_id%7D/%7Bquantity%7D", headers=headers)
res = conn.getresponse() data = res.read()
print(data.decode("utf-8"))
headers = {
'content-type': "application/json",
'authorization': "Basic REPLACE_BASIC_AUTH"
}
response = requests.request("GET", url, headers=headers)
print(response.text)
http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url) request["content-type"] = 'application/json' request["authorization"] = 'Basic REPLACE_BASIC_AUTH'
response = http.request(request) puts response.read_body
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET"); curl_easy_setopt(hnd, CURLOPT_URL, "https://gambio-shop.de/shop1/api.php/v2/products/{product_id}/product_prices/customer_groups/%7Bcustomer_group_id%7D/%7Bquantity%7D");
struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "authorization: Basic REPLACE_BASIC_AUTH"); headers = curl_slist_append(headers, "content-type: application/json"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://gambio-shop.de/shop1/api.php/v2/products/{product_id}/product_prices/customer_groups/%7Bcustomer_group_id%7D/%7Bquantity%7D"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("content-type", "application/json")
req.Header.Add("authorization", "Basic REPLACE_BASIC_AUTH")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
NSDictionary *headers = @{ @"content-type": @"application/json",
@"authorization": @"Basic REPLACE_BASIC_AUTH" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://gambio-shop.de/shop1/api.php/v2/products/{product_id}/product_prices/customer_groups/%7Bcustomer_group_id%7D/%7Bquantity%7D"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"]; [request setAllHTTPHeaderFields:headers];
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];
let headers = [ "content-type": "application/json", "authorization": "Basic REPLACE_BASIC_AUTH" ]
var request = NSMutableURLRequest(URL: NSURL(string: "https://gambio-shop.de/shop1/api.php/v2/products/{product_id}/product_prices/customer_groups/%7Bcustomer_group_id%7D/%7Bquantity%7D")!,
cachePolicy: .UseProtocolCachePolicy,
timeoutInterval: 10.0)
request.HTTPMethod = "GET" request.allHTTPHeaderFields = headers
let session = NSURLSession.sharedSession() let dataTask = session.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in if (error != nil) {
println(error)
} else {
let httpResponse = response as? NSHTTPURLResponse
println(httpResponse)
} })
dataTask.resume()
let uri = Uri.of_string "https://gambio-shop.de/shop1/api.php/v2/products/{product_id}/product_prices/customer_groups/%7Bcustomer_group_id%7D/%7Bquantity%7D" in let headers = Header.add_list (Header.init ()) [ ("content-type", "application/json"); ("authorization", "Basic REPLACE_BASIC_AUTH"); ] in
Client.call ~headers `GET uri
= fun (res, body_stream) -> (* Do stuff with the result *)