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
}
Field | Type | Description | Required |
---|---|---|---|
name | string | The name of the retail stock service. | Yes |
conf | object | Configuration details for the gateway. See below for its structure. | Yes |
gateway | string | The identifier for the gateway type (whippy ). | Yes |
is_active | boolean | Indicates whether the gateway should be active. | Yes |
Configuration Object (conf
):
The conf
object contains detailed settings for the stock gateway:
Field | Type | Description | Required |
---|---|---|---|
urls.query_store_stock_url | string | Whippy Ware BE URL for querying stock data. Use {sku} as a placeholder for a stock-keeping unit. | Yes |
login_url | string | Whippy Ware BE URL for the authentication endpoint. | Yes |
auth_params.username | string | Omnitron user’s username for authentication. | Yes |
auth_params.password | string | Omnitron 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:
Field | Description |
---|---|
pk | Primary key of the store, serving as a unique identifier. |
name | The name of the store. |
township | Details of the township where the store is located, including its city and country information. |
district | The district where the store is located. |
address | The full address of the store. |
phone_number | Contact phone number for the store. |
image | URL or reference to the store's image, if available. |
store_hours | Operating hours of the store, typically presented as a list. |
latitude | Geographical latitude coordinate of the store's location. |
longitude | Geographical longitude coordinate of the store's location. |
is_active | Boolean indicating whether the store is currently active. |
click_and_collect | Boolean indicating whether the store supports the click-and-collect service. |
store_type | Type of the store. |
kapida_enabled | Boolean indicating whether the store supports door delivery. |
fast_delivery | Boolean indicating whether the store offers fast delivery options. |
config | Configuration data specific to the store, usually presented as a key-value object. |
group | The group or category the store belongs to. |
sort_order | Determines the display order of the store in a list. |
created_date | The date and time when the store record was created. |
modified_date | The date and time when the store record was last updated. |
erp_code | The store's unique code in the ERP system. |
translations | Multilingual translations of the store’s attributes, if applicable. |
related_retail_stores | List of other retail stores related to this store. |
absolute_url | The 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"
}
]