Skip to content

whuu/ARCommerce.ProductAPI

Repository files navigation

ARCommerce.ProductAPI

Sitecore Commerce product API to use in Augmented Reality application. Compatible with Apple ARKit.
Check ARCommerce.ClientApp for sample usage.

Usage

Project adds two API endpoints for accessing products data:

  • Search for all products in the category (for given category item id) and return paths to object scan files assigned to the products:
    GET /api/cxa/ARCatalog/GetProductScans?cci={catalog item id}
    Returned JSON (sample):

     [
     		{
     		  "ProductId":"123456",
     		  "ScanFilePath":"/-/media/AR-Maps/123456/iron.arobject"
     		},
     		{
     		  "ProductId":"321654",
     		  "ScanFilePath":"/-/media/AR-Maps/321654/plate.arobject"
     		},
     		...
     ]
    
  • Get product details for given product id:
    GET /api/cxa/ARCatalog/ProductInformation?id={product id}
    Returned JSON (sample):

     {
          "DisplayName":"Azur 10/02",
          "Description":"Text Description.",
          "SummaryImageUrl":"/-/media/Images/Habitat/123456.png?h=220\u0026w=263\u0026hash=5C258CA2D56764DF5E0ACCEBDEB186BA",
          "Link":"/shop/Connectedhome%3dhabitat_master-connected%20home/PhilipsAzurGC4410%5B%5BSS%5D%5D02%3d123456",
          "ProductId":"123456",
          "AdjustedPriceWithCurrency":"7.00 USD",
          "ListPriceWithCurrency":"45.00 USD",
          "StockStatusLabel":"Out of Stock",
          ...
     }
    

To link AR object scan (.arobject file) with commerce product, upload it to Sitecore Media Library under /sitecore/media library/AR Maps/{product id} item. Path is configured in ARCommerce.Feature.Catalog.config.

To generate .arobject files you can install Scanning and Detecting 3D Objects app on iOS device.

Sample iOS client code for this API can be found here

Requirements

Sitecore XC 9.0 Update-2 with SXA

Installation

Put following files into \lib\Modules\Commerce folder:

  • Sitecore.Commerce.XA.Feature.Catalog.dll
  • Sitecore.Commerce.XA.Foundation.Catalog.dll
  • Sitecore.Commerce.XA.Foundation.Common.dll
  • Sitecore.Commerce.XA.Foundation.Connect.dll

Deploy ARCommerce.Feature.Catalog.csproj to your Sitecore Commerce website with Visual Studio.

About

Sitecore Commerce API for Augmented Reality application built in ARKit

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages