Required or optional
||Optional but required when using multiple domains to call the same reviews API feed||None
origin is the domain name of the web page where the Reviews API call is integrated. Only required where more than merchant domain is used to make the same Reviews API call.
Looking at an example, a merchant has integrated the Reviews API feed into their home page to show the most recent Feefo reviews. The page has both a desktop and mobile view served from different domains, the desktop view being www.mywebsite.com/index.html and the mobile view, m.mywebsite.com/index.html. Without the origin parameter, calling the same feed from the two domains will produce a Cross-Origin Request (CORS) error as Feefo caches the first domain name and sees the second domain name as not matching. Adding the origin parameter with a value of the domain name of the web page making the call will define the correct CORS header for the domain, therefore allowing both domains to publish the reviews without generating errors.
An example Reviews API call using origin is:
- version = the version of the API associated with the URL. See API Versions for the version number.
- all = returns both service and product reviews.
- merchant_identifier = the merchant's unique Feefo identifier, which in this example is example-retail-merchant.
- origin = the domain name of the web page making the reviews API call, in this example, it's m.mywebsite.com.
Full details about the API can be found at Reviews API (Customisable Integration).Reviews API Parameter: since_updated_periodReviews API Parameter: id