Support and Docs

3 Topics
Last post 11 November 2014 By Nadja Kristiansen
1 Topics
Last post 20 March 2014 By Carsten E. Madsen
0 Topics
Last post N/A By N/A
0 Topics
Last post N/A By N/A
1 Topics
Last post 02 April 2014 By Carsten E. Madsen

JSON-P

  • 03/03/2016

eSeller Cloud supports JSON-P, enabling cross-domain requests, e.g. displaying products from the JSON service on a blog at a different domain than the webshop.

By sending the "callback" parameter in requests to a service, the JSON result is wrapped inside a function, that can be used inside a <script> tag at a different domain. The name of the function will be whatever value is specified for the callback parameter.

JSON-P is supported by the JSON product services.

Example

Call to the JSON product service using the callback parameter:

/Services/ProductService.asmx/ProductList?v=1.0&lId=0&locId=65&so=7&cId=54&langId=1&countryId=11&customerId=0&mId=87601&p=1&rp=72&fn1=ProductPrice&fv1=120^120&callback=myProducts

Result:

/**/ typeof myProducts === 'function' && myProducts({"apiVersion":"1.0","id":null,"context":null,"servedBy":"WIN-U40EJDABCQS","data":{"kind":"Products","updated":"2016-03-01T14:24:55.227","lang":"da","currentItemCount":1,"productPerPage":72,"startPageNumber":1,"totalProducts":1,"pageNumber":1,"totalPages":1,"nextLink":"","previousLink":"","productMenus":[],"articles":[],"items":[{"extVariantId":null,"eSellerId":1860911,"id":"70071","name":"Men Sport Hoodie","variantId":0,"variantValues":null,"showProductId":true,"showProductEAN":false,"showProductManufacturereSKU":false,"showExtProductId":false,"showAltExtProductId":false,"hasVariants":false,"isVariant":false,"hasSalesPrice":true,"showSalesPrice":true,"manufacturerSKU":"","hasExpectedDeliveryDate":false,"expectedDeliveryDate":null,"expectedDeliveryDateFormatted":"","shipmentType":0,"isBuyable":true,"showAddToBasket":true,"showAddToFavorites":true,"addToFavoritesUrl":"/baction/atf.aspx?pid=1860911&rurl=%2fpl%2fMEN-HOODIES_87601.aspx","boundToInventoryCount":true,"inventoryCount":0,"inventoryCountFormatted":"0","grossWeight":0.00000,"grossWeightFormatted":"0,00000","stockStatusText":"","inStockMessage":"","notInStockMessage":"","bundleSize":0.00000,"smallestSalesUnit":0.00000,"secondaryId":"","posId":"","seoHtmlTitle":"","seoMetatagKeywords":"","seoMetatagDescription":"","EAN":"","unitOfMeasure":"STK","unitOfMeasureDesc":"STK","manufacturer":"","linkURL":"/pi/Men-Sport-Hoodie_1860911_87601.aspx","linkName":"","vendor":"","URLPathAndQuery":"/pi/Men-Sport-Hoodie_1860911_87601.aspx","salesPrices":[{"quantity":1.0,"quantityFormatted":"1","salesUnit":"STK","hasBetterPrice":false,"tagPrice":120.0000000000,"tagPriceFormatted":"DKK 120,00","tagPriceVATAmount":0.0000000000,"tagPriceVATAmountFormatted":"DKK 0,00","tagPriceExcVATAmountFormatted":"DKK 120,00","tagPriceExcVATAmount":120.00000,"tagPriceIncVATAmountFormatted":"DKK 120,00","tagPriceIncVATAmount":120.0000000000,"totalTagPrice":120.0000000000,"totalTagPriceFormatted":"DKK 120,00","totalTagPriceVATAmount":0.0000000000,"totalTagPriceVATAmountFormatted":"DKK 0,00","totalTagPriceExcVATAmountFormatted":"DKK 120,00","totalTagPriceExcVATAmount":120.00000,"totalTagPriceIncVATAmountFormatted":"DKK 120,00","totalTagPriceIncVATAmount":120.0000000000,"hasPreviousPrice":false,"previousTagPriceFormatted":"","previousTagPrice":0.0,"hasRecommendedPrice":false,"listTagPrice":0.0,"listTagPriceFormatted":"","lineDiscountPercentage":0.0,"lineDiscountPercentageFormatted":"0,00","tagPriceLineDiscountAmount":0.0,"tagPriceLineDiscountAmountFormatted":"DKK 0,00","description":null}],"images":[{"url":"http://www.myshop.com/Services/ImageHandler.ashx?imgId=297905&sizeId=3338"}],"frontPageProduct":false,"greatBuy":false,"noveltyProduct":false,"deprecated":false,"kind":"Product","customFields":{"frontpageNews":"True","frontpageMostSold":"True","shortDesc":"Men Sport Hoodie","Video":""},"isGiftCard":false,"productRelatedLink":"http://","productRelatedLinkText":"","suggestedQuantity":null}]}});