API Reference

Documentation for Locally's "ShopSense" Advanced Analytics reports

ShopSense provides three levels of advanced analytics reporting:

  1. ShopSense Inventory provides brands with reporting of inventory levels and inventory changes at stores
  2. ShopSense Inventory and Sales provides brands with all inventory reporting, plus calculated sales data
  3. ShopSense Inventory, Sales and Demand provides brands with all inventory and sales reporting, plus consumer demand signals

ShopSense Inventory

With ShopSense inventory, brands can view inventory levels at stores, prices, and inventory changes over time.

Report Index

The main "Report Index" page provides you with a list of "splits" (stores) in your report, and how many pages each split contains. To load the main "Report Index" page, call the following URL:

GET https://www.locally.com/api/v2/reports/json/{{uuid}}

curl --request GET \
  --url '<https://www.locally.com/api/v2/reports/json/{{uuid}}' \
  --header 'Locally-Api-Token: {{API_TOKEN}}'

Sample Response:

{
    "version": 2,
    "status": true,
    "properties": {
        "uuid": "127hyb-t5ad-4cbj5-a2a1-0zbay914d170",
        "report_date": "2025-02-15"
    },
    "content": [
        {
            "split_name": "458758",
            "first_page": "https://www.locally.com/api/v2/reports/json/3eb76cae-c2ad-4be5-ada1-0ba91d111d40/458758/0",
            "total_pages": 1
         }
    ]
}

In this example, the report ran on February 15th, 2025, and it consists of one split (one store), and that split has one page. A direct link to the first page of each split is provided in the "Content" section. Your report will likely contain many stores, and each store's splits will be of varying lengths (stores that carry a larger assortment will have multiple pages of inventory, etc.).

Retrieving inventory for a specific store

With ShopSense Inventory, each "split" in your report corresponds to an individual store. To load inventory details for a specific store, you'll call the following URL, which is also provided in the main Report Index results:

GET https://www.locally.com/api/v2/reports/json/{{uuid}}/{{split_id}}/0

Request:

curl --request GET \
  --url '<https://www.locally.com/api/v2/reports/json/{{uuid}}/{{split_id}}/0>' \
  --header 'Locally-Api-Token: {{API_TOKEN}}'

The split_id is the locally store_id, and the first page of each split is always 0 .

Sample Response:

{
    "version": 2,
    "status": true,
    "properties": {
        "uuid": "127hyb-t5ad-4cbj5-a2a1-0zbay914d170",
        "current_page": 0,
        "split_id": "sample-shopsense-inventory-report-20250221012345-458758",
        "split_name": "458758",
        "total_pages": 1,
        "total": 1,
        "per_page": 100,
        "report_date": "2025-02-21"
    },
    "content": [
        {
            "store_name": "Locally Test Store #1",
            "store_company_name": "Locally Test Retailer",
            "vendor_id": "13579",
            "company_name": "Locally Test Brand",
            "product_category": "Guitars",
            "product_name": "Keith Richards Signature Telecaster",
            "upc": "848426073865",
            "gender": "Unisex",
            "size_1": "One Size",
            "color_name": "Butterscotch Blonde",
            "msrp": "5735 USD",
            "retailer_price": "5545 ",
            "updated": "2025-02-15",
            "actual_inventory_decrease": "-1",
            "quantity_on_hand": "2"
        },
	  ]
}

In this example, the store has one UPC in-stock. The current quantity is 2, and there was one inventory depletion since the prior report. The item MSRP is $5,735 USD, and the store is selling it for $5,545.

Your report will likely contain numerous entries in the "content" section, for each item (UPC) that's in-stock at each store.

Response Explanation [Properties]

Definitions of the Properties section of the response:

FieldDefinition
versionLocally API version
statustrue if request was a success, false if not
uuidUUID of the report
current pageThe page number you are currently viewing
split_idThe unique id of the current split being viewed
split_nameThe name of the split being viewed (this is the Locally store_id for the given store)
total_pagesThe number of pages for that split
totalThe total number of content items in the current split (i.e. number of individual UPCs in the store's inventory)
per_pageThe number of content items per page
report_dateDate the report was generated

Response Explanation [Content]

The Content section of the response contains the store's inventory data and some associated product details. The specific parameters here are illustrative of a typical report, but parameters can be removed or added based on your specific needs, so your report may be slightly different.

FieldDefinition
store_nameThe name of the retail store
store_company_nameThe company or business name of the retailer
vendor_idThe brand's unique identifier for store (if available)
company_nameThe name of the brand or manufacturer of the product
product_categoryThe Locally category
product_nameThe name of the specific product model or item
upcThe Universal Product Code (UPC) for the item
genderThe gender category for the product
size_1The size of the product, if applicable (e.g., One Size, Medium).
color_nameThe color of the product
msrpThe Manufacturer’s Suggested Retail Price (MSRP) for the product, typically including the currency.
retailer_priceThe price at which the retailer is selling the item.
updatedThe date when the report last ran
actual_inventory_decreaseThe number of units depleted from inventory since the last report.
quantity_on_handThe total number of units currently available in the store's inventory.