Originally written by Jack Thompson, last updated Jan 24, 2022, on the Swan Retail knowledge base (SRS).
The EKM API integration within SRS enables sending of product information and web hierarchy from SRS and sharing of order information.
This document details the functionality of the integration and how this works within SRS.
https://api.ekm.net/documentation/index.html
Currently supported:
|
EKM Data |
SRS Data |
|---|---|
|
Categories (menus, category pages etc.) |
Web hierarchies |
|
Products |
Product details (brand, description, specifications, images, attributes etc), stock levels, was/now pricing |
|
Variants |
Styles & models (e.g. fashion size, colour and fit) |
|
Product Attributes |
Product filter data (e.g. style, model, attributes) |
|
Orders |
Sales order (products, payments, customer information) |
|
Order statuses |
Sales order status updates (e.g. scheduled for delivery) |
Products
EKM API Documentation: https://api.ekm.net/documentation/index.html#tag/Products
SRS sends items to EKM if they are checked as Web Enabled within Item Maintenance. Any changes to Web Enabled items will result in an update being sent to EKM.
Removing the Web Enabled indicator will cause the item to be removed from EKM.
The web branch is taken from the value within the shopify_integration table. Only items marked as Web Enabled at this branch will be sent to EKM.
The web factor (the percentage of inventory that is made available to the web) is set within Company Maintenance.
As well as sending item information, inventory levels are also sent on any newly web enabled items or updates to existing web enabled items.
Create Product
There are multiple options when creating products depending on the setup within SRS. These include:
-
Creation of a new product
-
Creation of a product with variants
For products with variants, the parent product is created in Model Maintenance and the variants are created as Items in Item Maintenance and assigned to the Model.
For models with variants the model is created first and then the variants are sent to EKM
POST /admin/api/{api_version}/products/{product_id}/variants.json
Images are sent to EKMseparately once the Product has been created.
POST /admin/api/{api_version}/products/{product_id}/images.json
Update Product
Product updates are triggered by amending a web enabled item in Item Maintenance or Model in Model Maintenance.
PUT /admin/api/{version_id}/products/{product_id}.json
The fields for the Update endpoint are the same as those used for the Create.
Delete Product or Variant
Deleting a product in SRS will delete it from EKM
DELETE /admin/api/{api_version}/products/{product_id}/variants.json
Delete Images
Whenever images are removed from the Item or Model, the associated products are updated on EKM without the images that have been removed.
Stock Levels
Updated stock levels are sent to EKM for an item whenever that item is web enabled or (already being web enabled) updated. This stock level is worked out from the web branch and the value of the Web factor as set in Company Maintenance.
Orders
EKM API Documentation: https://shopify.dev/docs/admin-api/rest/reference/orders/order
Get Orders
Orders are pulled down from EKM on a schedule. Orders are retrieved based on the ID of the last order retrieved from EKM (this is stored in the database in the shopify_order table).
GET /admin/api/{api_version}/orders.json?since_id={last_retrieved_id}
This endpoint can take any of the following as a parameter:
|
Parameter |
Description |
|---|---|
|
since_id |
The Shopify ID of the last order to be retrieved from Shopify. This is stored in the shopify_order table, shopify_order_number field |
|
created_at_min |
The time of the last check for orders |
|
limit |
Defines a maximum number of results to return |
Web Hierarchy
EKM API Documentation: https://shopify.dev/docs/admin-api/rest/reference/products/smartcollection
The Web Hierarchy setup within SRS is sent to EKM as a Smart Collection. The link between an SRS Web Hierarchy and a EKM Smart Collection is held within the database in the shopify_web_hierarchy table.
Any changes to Web Hierarchy within SRS result in a POST of the hierarchy to EKM.
There is no way to delete a hierarchy from EKMwithin SRS. Instead make any changes required to the hierarchy within SRS and save. This will result in the hierarchy being resent to EKM.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article