This is the real getInternationalPricing method for all environments. It reads from cookies to detect a shopper's selected location, providing product information in the currency of the 'shippingCountry' in the cookies.
Go to the test-only version: ImpSdk._testGetInternationalPricing
products, callback);| Parameter | Type | Description |
|---|---|---|
products |
Array | Required. Array of strings representing the product ids of the items we want international prices for. |
callback |
Function | Required. Function as Node.js-style callback, executed on the error or result returned by our endpoint. Typically this function is an anonymous function defined within the call to ImpSdk.getInternationalPricing( ) but can also be a pre-defined function. This function usually has an if-else block handling the error or result. The callback will be executed with two arguments: callback(error, result); |
error, result);| Parameter | Type | Description |
|---|---|---|
error |
Object | Object or null. When error is an Object it has properties describing the error. |
| Property | Description | |
errorCode |
Number code representing the API error code from our IMP-API endpoint. | |
message |
String describing the likely cause of the error. | |
stack |
String showing the stack trace of the error. Note: this is a long string and can generally be ignored. | |
status |
Number representing the status code of the REST API call to our endpoint, ie 200, 400, 404, 500. | |
result |
Object | Object or undefined. When result is an Object it has an array of products. |
| Property | Description | |
products |
Array of objects representing the products we requested. Each object holds pricing information for a single product. *See the chart below for details on each Object. |
result.products[i] |
Object | The ith element of the array in the result passed to our callback. |
|---|---|---|
| Property | Description | |
id |
String value of the product id number. | |
name |
String. Name of the product. | |
countryEligible |
Boolean indicating if the item is eligible for shipping to the requested country. | |
currency |
Object containing details about the currency. Reference it with result.products[i].currency which has properties{ countryCode: two-letter abbreviation of the countrycountryName: name of the countrycurrencyCode: three-letter abbreviation of the currencycurrencyName: name of the accepted currencyexchangeRate: a multiple (may contain decimals) of U.S. DollarfrontLoadCoefficient: NumberroundMethod: the number of decimal places to include in rounding} |
|
price |
Object containing the details about the price. Reference it with result.products[i].price which has properties{ basePriceType: NumberdisplayCode: StringintermediateSaleValue: NumberonEdv: BooleanonSale: BooleanoriginalPrice: NumberpriceType: NumberretailPrice: NumbersaleValue: NumberwillBe: Boolean} |