Skip to main content

Find in Store for Whippy Ware

This document provides a detailed guide on implementing and utilizing the Find in Store feature with Whippy Ware, designed to enhance customer experience by allowing users to check the availability of a product in specific stores. This feature integrates with brand-specific stock services and provides real-time stock information across retail locations.

To utilize this functionality, the relevant stock settings must first be configured in the Omnitron. Specific implementations of the RetailStockGateway class are required for each brand, ensuring compatibility with their unique stock services.

Retail Stock Gateway

To query which store a product is available in, a stock setting must first be configured for the relevant Commerce channel through the Omnitron > Sales Channels > Sales Channel Settings > Store Stock Settings screen. For more details, refer to the How to Manage Store Stock Settings? documentation.

To integrate Whippy Ware, you must create a Retail Stock Gateway using the API endpoint below:

POST Create a Retail Stock Gateway for Whippy Ware

This endpoint is used to create a retail stock gateway that integrates with Whippy Ware to fetch and manage retail stock information.

Path: {omnitron_url}/api/v1/remote/1/retail_stock_gateways/

Headers:

  • Authorization: Token <OMNITRON_ACCESS_TOKEN>

Example Request

The request must include the following fields. Ensure the URLs in the configuration point to Whippy Ware's backend (BE).

{
"name": "Retail Store Stock Service Name",
"conf": {
"urls": {
"query_store_stock_url": "{whippy_ware_be_url}/api/v1/stocks/?sku={}"
},
"login_url": "{whippy_ware_be_url}/api/v1/auth/login/",
"auth_params": {
"username": "omnitron_user_username",
"password": "omnitron_user_password"
}
},
"gateway": "whippy",
"is_active": true
}
FieldTypeDescriptionRequired
namestringThe name of the retail stock service.Yes
confobjectConfiguration details for the gateway. See below for its structure.Yes
gatewaystringThe identifier for the gateway type (whippy).Yes
is_activebooleanIndicates whether the gateway should be active.Yes

Configuration Object (conf):

The conf object contains detailed settings for the stock gateway:

FieldTypeDescriptionRequired
urls.query_store_stock_urlstringWhippy Ware BE URL for querying stock data. Use {sku} as a placeholder for a stock-keeping unit.Yes
login_urlstringWhippy Ware BE URL for the authentication endpoint.Yes
auth_params.usernamestringOmnitron user’s username for authentication.Yes
auth_params.passwordstringOmnitron user’s password for authentication.Yes

Example Response

{
"pk": 100,
"name": "Retail Store Stock Service Name",
"conf": {
"urls": {
"query_store_stock_url": "{whippy_ware_be_url}/api/v1/stocks/?sku={}"
},
"login_url": "{whippy_ware_be_url}/api/v1/auth/login/",
"auth_params": {
"username": "omnitron_user_username",
"password": "omnitron_user_password"
}
},
"gateway": "whippy",
"is_active": true
}

GET Product Store Stock Query

Once the Omnitron configuration is complete, users can query the store stock information for a product using the following Commerce endpoint:

Path: {commerce_url}/retail_store_stock/{product_id}/

Whippy stock location code must match the erp_code specified during the creation of a store in Omnitron. This ensures accurate alignment of stock data between systems.

Omnitron > Store Management > Stores > Add/Edit Store > ERP Code parameter:

Whippy Ware > Stock Locations > Create Stock Location > Code parameter:

Example Response

The response is generated through the implemented Retail Stock Gateway, as described above.

The fields include:

FieldDescription
pkPrimary key of the store, serving as a unique identifier.
nameThe name of the store.
townshipDetails of the township where the store is located, including its city and country information.
districtThe district where the store is located.
addressThe full address of the store.
phone_numberContact phone number for the store.
imageURL or reference to the store's image, if available.
store_hoursOperating hours of the store, typically presented as a list.
latitudeGeographical latitude coordinate of the store's location.
longitudeGeographical longitude coordinate of the store's location.
is_activeBoolean indicating whether the store is currently active.
click_and_collectBoolean indicating whether the store supports the click-and-collect service.
store_typeType of the store.
kapida_enabledBoolean indicating whether the store supports door delivery.
fast_deliveryBoolean indicating whether the store offers fast delivery options.
configConfiguration data specific to the store, usually presented as a key-value object.
groupThe group or category the store belongs to.
sort_orderDetermines the display order of the store in a list.
created_dateThe date and time when the store record was created.
modified_dateThe date and time when the store record was last updated.
erp_codeThe store's unique code in the ERP system.
translationsMultilingual translations of the store’s attributes, if applicable.
related_retail_storesList of other retail stores related to this store.
absolute_urlThe absolute URL to the store's detail page or resource in the system.
[
{
"pk": 1,
"name": "CITY AVM",
"township": {
"pk": 1,
"is_active": true,
"name": "xxx",
"city": {
"pk": 1,
"is_active": true,
"name": "xxx",
"country": {
"pk": 1,
"is_active": true,
"name": "xxx",
"code": "byt",
"translations": null
}
}
},
"district": null,
"address": "xxx",
"phone_number": "xxx",
"fax_phone_number": null,
"image": null,
"store_hours": [
["09:00:00", "18:00:00"],
["09:00:00", "18:00:00"],
["09:00:00", "18:00:00"],
["09:00:00", "18:00:00"],
["09:00:00", "18:00:00"],
["09:00:00", "18:00:00"],
[null, null]
],
"latitude": null,
"longitude": null,
"is_active": true,
"click_and_collect": false,
"store_type": null,
"kapida_enabled": false,
"fast_delivery": false,
"config": {},
"group": null,
"sort_order": null,
"created_date": "2024-12-16T10:20:51.542582Z",
"modified_date": "2024-12-16T10:20:51.542601Z",
"erp_code": "M34",
"translations": null,
"related_retail_stores": [],
"absolute_url": "/address/retail_store/1/",
"stock": 1,
"remote_store_name": "CITY REAL STORE"
}
]