Product API Guide

GET /product/getproductprice

Overview

The Get Product Price endpoint retrieves pricing for one or more products.

For currencies with a configured product price, the endpoint returns the current price. If no price is configured for a requested currency, Cleverbridge calculates the price using exchange rates that are updated daily.

Use cases

Use this endpoint to:

  • Retrieve the current price of specific products in one or more currencies.
  • Display product prices on your website without opening the Cleverbridge cart.
  • Compare prices shown on your website with the prices displayed in the Cleverbridge cart.
  • Retrieve prices in currencies that are not configured in Cleverbridge. In this case, Cleverbridge calculates the price using the current daily exchange rate.

Get Product Price vs. Pricing API

Cleverbridge also offers Pricing API. Use the table below to determine which endpoint best fits your integration scenario.

If you need to...Use Get Product PriceUse Pricing API
Retrieve pricing from a backend application or service✅
Display localized prices directly on a website✅
Retrieve prices for multiple products in one request✅
Retrieve prices in one or more specified currencies✅
Automatically determine pricing based on the customer's IP address✅
Use REST API authentication✅
Integrate using a JavaScript SDK✅
Generate pricing for emails, reports, PDFs, or internal systems✅
Dynamically update pricing in the browser✅
Display promotions and discounts on a marketing website✅
Synchronize pricing with internal business applications✅

Implement Get Product Price endpoint

Before you start

Before calling this endpoint, make sure you have:

  • A Cleverbridge REST API username and password.
  • Base64-encoded API credentials for the Authorization header.
  • The IDs of the products whose prices you want to retrieve.
  • One or more currency IDs (for example, EUR, USD, or JPY).

For information about REST API authentication, see the authentication documentation.

❗️

Warning

Avoid calling this endpoint frequently. Excessive requests can generate significant server traffic.

Cleverbridge recommends that you make these API calls during low-peak visitor hours (12 midnight to 3 am, local time). Before using this resource outside of these hours, contact Client Experience for more information.

Parameters

ParameterTypeRequiredExampleDescription
currencyIdsstringYesUSDComma-separated list of currency IDs for which to retrieve product prices.
productIdsstringYes293103Comma-separated list of Cleverbridge product IDs.

Request

GET /product/getproductprice?currencyIds={currencyIds}&productIds={productIds}

Example request

curl --location 'https://rest.cleverbridge.com/product/getproductprice?currencyIds=USD&productIds=293103' \
--header 'Accept: application/json' \
--header 'Authorization: Basic YOUR_BASE64_ENCODED_CREDENTIALS'
import http.client

conn = http.client.HTTPSConnection("rest.cleverbridge.com")
payload = ''
headers = {
  'Accept': 'application/json',
  'Authorization': 'Basic OUR_BASE64_ENCODED_CREDENTIALS'
}
conn.request("GET", "/product/getproductprice?currencyIds=USD&productIds=293103", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
var https = require('follow-redirects').https;
var fs = require('fs');

var options = {
  'method': 'GET',
  'hostname': 'rest.cleverbridge.com',
  'path': '/product/getproductprice?currencyIds=USD&productIds=293103',
  'headers': {
    'Accept': 'application/json',
    'Authorization': 'Basic YOUR_BASE64_ENCODED_CREDENTIALS'
  },
  'maxRedirects': 20
};

var req = https.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function (chunk) {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });

  res.on("error", function (error) {
    console.error(error);
  });
});

req.end();
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.get("https://rest.cleverbridge.com/product/getproductprice?currencyIds=USD&productIds=293103")
  .header("Accept", "application/json")
  .header("Authorization", "Basic OUR_BASE64_ENCODED_CREDENTIALS")
  .asString();

Example response

<?xml version="1.0" encoding="utf-8"?>
<GetProductPriceResponse
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://api.cleverbridge.com/datacontract">
  <ResultMessage>OK</ResultMessage>
  <Products>
    <Product>
      <Id>293103</Id>
      <ProductPrices>
        <ProductPrice>
          <CurrencyId>EUR</CurrencyId>
          <Quantity>1</Quantity>
          <SinglePriceGross>100</SinglePriceGross>
          <SinglePriceNet>84.03</SinglePriceNet>
          <SinglePriceVat>15.97</SinglePriceVat>
          <TotalPriceGross>100</TotalPriceGross>
          <TotalPriceNet>84.03</TotalPriceNet>
          <TotalPriceVat>15.97</TotalPriceVat>
        </ProductPrice>
      </ProductPrices>
    </Product>
  </Products>
</GetProductPriceResponse>

📘

Note

The response above is provided as an example only.
For the complete response schema and additional examples, see Additional Examples - Get Product Price.




Did this page help you?