Retail Stores

Embodies the actual retail locations where the product is sold.

Users can add/delete/update stores in Omnitron with GET, POST, PATCH, PUT and DELETE requests via api/v1/retail_stores/ endpoint.

GET Retail Stores

Path: api/v1/retail_stores/

Path: api/v1/retail_stores/<pk>/

When a GET request is made directly from retail_stores/, users can get all stores. If a user sends a GET request like retail_stores/1/ they will get the store with ID value 1 (instead of 1 send the id you need). Associated data has only an ID value.

{
   "count": 5,
   "next": null,
   "previous": null,
   "results": [
       {
           "pk": 1,
           "name": "Shop 1",
           "township": 1,
           "district": 5,
...

Path: api/v1/retail_stores/detailed/

Path: api/v1/retail_stores/<pk>/detailed/

Sending a request to the detailed/ endpoint will result in a list of properties of the related data.

POST Create a Retail Store

Parameters for creating a retail store are displayed in the table below.

Parameter

Data Type

In

Required

Description

name

string

body

YES

Name of the store

address

string

body

YES

Address details

township

ID

body

YES

Township ID value

phone_number

string

body

YES

Phone number

channels

ID List

body

YES

Sales channel ID values

store_type

ID or null

body

YES

Store type ID value

fax_phone_number

string

body

YES

Fax phone number

click_and_collect

Boolean

body

YES

Permission for getting products from Store

store_hours

List

body

YES

Work hours

is_active

Boolean

body

YES

Activity status

district

ID

body

District ID value

latitude

number

body

Latitude

longitude

number

body

Longitude

kapida_enabled

boolean

body

A field specific to a project

fast_delivery

boolean

body

Status of fast delivery

erp_code

string

body

Store erp code

When a post request is made to the retail_stores/ endpoint, such as the example data below, the creation process takes place.

Path: api/v1/retail_stores/

Request

Response

Access the data below for the District, Township, Channels and Store Type that you will need in order to use the above request.

District: Get it by sending a GET request to the api/v1/districts/ endpoint.

Township: Get it by sending a GET request to the api/v1/townships/ endpoint.

Channels: Get it by sending a GET request to the api/v1/channels/ endpoint.

Store Type: : Get it by sending a GET request to the api/v1/retailstore_type/ endpoint.

PATCH Modify an Existing Retail Store

When a patch request, such as the sample data below, is sent to the retail_stores/ID/ endpoint, the update process will be completed. Update the store whose ID value is 1 (replace 1 with the ID value you need).

Path: api/v1/retail_stores/{pk}/

Access the data below for the District, Township, Channels and Store Type that you will need to use the above request.

District: Get it by sending a GET request to the api/v1/districts/ endpoint.

Township: Get it by sending a GET request to the api/v1/townships/ endpoint.

Channels: Get it by sending a GET request to the api/v1/channels/ endpoint.

Store Type: Get it by sending a GET request to the api/v1/retailstore_type/ endpoint

PUT Modify an existing Retail Store

When a PUT request is sent like the example data below to the retail_stores/ID/ endpoint, the entire field will be updated. Update the store whose ID value is 1 (replace 1 with the ID value you need).

Path: api/v1/retail_stores/{pk}/

Access the data below for the District, Township, Channels and Store Type that you will need to use the above request.

District: Get it by sending a GET request to the api/v1/districts/ endpoint.

Township: Get it by sending a GET request to the api/v1/townships/ endpoint.

Channels: Get it by sending a GET request to the api/v1/channels/ endpoint.

Store Type: Get it by sending a GET request to the api/v1/retailstore_type/ endpoint.

DELETE Retail Store

When a delete request is sent like the example data below to the retail_stores/ID/ endpoint the deletion will be completed. Delete the store with ID value of 1 (substitute with ID value you need). This will update the is_active value to False, but won’t delete the relevant model.

Path: api/v1/retail_stores/{pk}/

Special Endpoints


add_districts

Provide a new neighborhood definition to the config value of the store by sending a POST request to the /api/v1/retail_stores/{retail_stores_id}/add_districts/ endpoint.

POST Add Districts to a Retail Store

Path: /api/v1/retail_stores/{retail_stores_id}/add_districts/


remove_districts

Send a POST request to /api/v1/retail_stores/{retail_stores_id}/remove_districts/endpoint so that a new neighborhood is deleted in the config value of the store.

POST Remove Districts in a Retail Store

Path: /api/v1/retail_stores/{retail_stores_id}/remove_districts/

Last updated

Was this helpful?