ImpSdk.getInternationalPricing

API developed by Murali Balusa
SDK developed by Timmy Luong

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

Demonstration:

Previous result:

ImpSdk.getInternationalPricing(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);

callback(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 country
  countryName: name of the country
  currencyCode: three-letter abbreviation of the currency
  currencyName: name of the accepted currency
  exchangeRate: a multiple (may contain decimals) of U.S. Dollar
  frontLoadCoefficient: Number
  roundMethod: 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: Number
  displayCode: String
  intermediateSaleValue: Number
  onEdv: Boolean
  onSale: Boolean
  originalPrice: Number
  priceType: Number
  retailPrice: Number
  saleValue: Number
  willBe: Boolean
}