Application Settings Services
All services related to application settings are listed in this page.
GET
List Application Settings
This service is used to retrieve all application settings with detailed information.
Path: /api/v1/oms/settings/application_settings/
Query Parameters
The following query parameters can be used to get information about application settings.
Parameter | Data Type | In | Description |
---|---|---|---|
token | string | header | The API key of the customer account |
Example Request
To get a list of all application settings, a GET
request should be sent to the /api/v1/oms/settings/application_settings/
endpoint.
Here's an example of how to make the request in python:
import requests
url = "https://{domain_url}/api/v1/oms/settings/application_settings/"
token = "f532eXXXXXXXXXXXXXXXXX201XXXXX9332d"
headers = {
'Content-Type': 'application/json',
'Authorization': f'Token {token}'
}
response = requests.request('GET', url, headers=headers)
print(response.json())
Example Response (200 OK)
In a successful response with a status code of 200 OK, the API returns all the application settings. The response body contains JSON
objects of application settings and their attributes such as ID, key and json_value.
These attributes are described in the following table.
Parameter | Data Type | Description |
---|---|---|
id | integer | The ID of the application setting |
key | string | The key info of the application setting |
json_value | string | The value info of the application setting |
This example response serves as a reference to understand the structure and data format returned from this API service.
{
"count": 6,
"next": "https://{domain_url}/api/v1/oms/settings/application_settings/",
"previous": null,
"results": [
{
"id": 1,
"key": "IS_TRADEIN_ENABLED",
"json_value": false
},
{
"id": 2,
"key": "test_count",
"json_value": 1
},
{
"id": 3,
"key": "test_key",
"json_value": "test_value"
},
{
"id": 4,
"key": "GEOCODE_PROVIDER_SETTINGS",
"json_value": {
"conf": {
"api_key": "f532eXXXXXXXXXXXXXXXXX201XXXXX9332d",
"base_url": "https://{map_url}",
"timeouts": {
"read": 50.0,
"connect": 5.0
}
},
"client": "yandex"
}
},
{
"id": 5,
"key": "OMNITRON_CLIENT_SETTINGS",
"json_value": {
"auth": {
"password": "123",
"username": "oms.application"
},
"urls": {
"oms_url": "{oms_url}",
"base_url": "{omnitron_url}"
},
"timeouts": {
"read": 6000.0,
"connect": 6000.0
}
}
},
{
"id": 6,
"key": "ORDER_FILTERING",
"json_value": {
"status": {
"enum": "oms.orders.enums.OrderStatus",
"value": "approved"
},
"channel": [
1
],
"is_send": true
}
}
]
}
GET
Retrieve Single Application Setting Detail
This service is used to retrieve detailed information about a single application setting with a specific ID.
Path: /api/v1/oms/settings/application_settings/{id}/
Query Parameters
The following query parameters can be used to get the information about a specific application setting.
Parameter | Data Type | In | Description |
---|---|---|---|
token | string | header | The API key of the customer account |
{id} | integer | url | The ID of the application setting |
Example Request
To retrieve detailed information of a specific application setting, a GET
request should be sent to the /api/v1/oms/settings/application_settings/{id}/
endpoint.
Here's an example of how to make the request in python:
import requests
url = "https://{domain_url}/api/v1/oms/settings/application_settings/{id}/"
token = "f532eXXXXXXXXXXXXXXXXX201XXXXX9332d"
headers = {
'Content-Type': 'application/json',
'Authorization': f'Token {token}'
}
response = requests.request('GET', url, headers=headers)
print(response.json())
Example Response (200 OK)
In a successful response with a status code of 200 OK, the API returns the detailed information of a specific application setting. The response body contains a JSON
object with the attributes such as ID, key and json_value.
These attributes are described in the following table.
Parameter | Data Type | Description |
---|---|---|
id | integer | The ID of the application setting |
key | string | The key info of the application setting |
json_value | string | The value info of the application setting |
This example response serves as a reference to understand the structure and data format returned from this API service. It is showed ORDER_FILTERING
setting as an example.
{
"id": 36,
"key": "ORDER_FILTERING",
"json_value": {
"status": {
"enum": "oms.orders.enums.OrderStatus",
"value": "approved"
},
"channel": [
1
],
"is_send": false
}
}
GET
Retrieve Application Setting Fields
Every application setting has unique key
. json_value
of every application setting differs according to its key
.
This service is used the get the json_value
details of a specific key
.
Path: /api/v1/oms/settings/application_settings/settings_fields/
Query Parameters
The following query parameters can be used to get the information about json value of a specidic application setting
The settings_key
field is mandatory; otherwise, the server will respond with a 400 Bad Request error.
Parameter | Data Type | In | Description |
---|---|---|---|
token | string | header | The API key of the customer account |
settings_key | string | params | The key of the application setting |
These are the list of setting keys
in the system.
You can provide one of them as a query parameter.
Application Settings Key |
---|
GEOCODE_PROVIDER_SETTINGS |
GEOLOCATION_DISCOVERY |
MAX_FULFILMENT_TIME_OF_ORDER_ITEM |
OMNITRON_CLIENT_SETTINGS |
ORDER_ITEM_EXCLUSION_METHODS |
ORDER_FILTERING |
PACKAGE_NUMBER_GENERATOR_PATTERN |
IS_CLICK_AND_COLLECT_ENABLED |
SHIPPED_THRESHOLD_DAYS |
IS_RESERVATION_ACTIVE |
COD_FEE_BASE_CODE_VALUE |
MIN_ORDER_OMNITRON_ID |
OMNITRON_APPLICATION_ID |
CLASS_MAPPING |
IS_TRADEIN_ENABLED |
ALLOWED_PACKAGE_STATES_FOR_RESERVATION |
ALLOWED_TRANSFER_STATES_FOR_RESERVATION |
IS_THE_PICKUP_LOCATION_FROM_THE_STORE_PACKING_CENTER |
Example Request
To get a details of json_value of a specific application setting, a GET
request should be sent to the /api/v1/oms/settings/application_settings/settings_fields/
endpoint.
Here's an example of how to make the request in python:
import requests
url = "https://{domain_url}/api/v1/oms/settings/application_settings/settings_fields/?settings_key=ORDER_FILTERING"
token = "f532eXXXXXXXXXXXXXXXXX201XXXXX9332d"
headers = {
'Content-Type': 'application/json',
'Authorization': f'Token {token}'
}
response = requests.request('GET', url, headers=headers)
print(response.json())
Example Response (200 OK)
In a successful response with a status code of 200 OK, the API returns the json_value details of given application setting. The response body contains a JSON
object with the attributes such as type, required, children etc.
These attributes are described in the following table.
Parameter | Data Type | Description |
---|---|---|
type | string | What kind of data will be stored in the application setting for example an object, list or integer ? |
required | boolean | Is it required to show application setting on the frontend ? |
read_only | boolean | Is the application setting read only or can be updated ? |
label | string | label of the application setting |
children | json | Sub fields of the application setting (if it has) |
This example responses serve as a reference to understand the structure and data format returned from this API service.
ORDER_FILTERING
setting has a json_value
as follows:
{
"json_value": {
"type": "nested object",
"required": true,
"read_only": false,
"label": "Json value",
"children": {
"status": {
"type": "nested object",
"required": false,
"read_only": false,
"label": "Status",
"children": {
"enum": {
"type": "string",
"required": true,
"read_only": false,
"label": "Enum"
},
"value": {
"type": "string",
"required": true,
"read_only": false,
"label": "Value"
}
}
},
"channel": {
"type": "list",
"required": false,
"read_only": false,
"label": "Channel",
"child": {
"type": "field",
"required": true,
"read_only": false
}
},
"is_send": {
"type": "boolean",
"required": false,
"read_only": false,
"label": "Is send"
}
}
}
}
SHIPPED_THRESHOLD_DAYS
setting has a json_value
as belows.
{
"json_value": {
"type": "integer",
"required": true,
"read_only": false,
"label": "Json value",
"min_value": 1
}
}
POST
Create Application Setting
This service is used to create a new application setting with the request body.
Path: /api/v1/oms/settings/application_settings/
Request Body
The following request body parameters can be used to create an application setting object.
Parameter | Data Type | In | Description |
---|---|---|---|
token | string | header | The API key of the customer account |
key | string | body | The key of the application setting |
json_value | string | body | The json value of the application setting |
json_value
parameter differs for each other application setting. The value of this field must be obtained from the Application Settings Fields
service by key.
For instance, ORDER_FILTERING
setting has a request body as follows:
{
"key": "ORDER_FILTERING",
"json_value": {
"status": {
"enum": "oms.orders.enums.OrderStatus",
"value": "approved"
},
"channel": [
1
],
"is_send": true
}
}
SHIPPED_THRESHOLD_DAYS
setting has a request body as follows:
{
"key": "SHIPPED_THRESHOLD_DAYS",
"json_value": 5
}
Example Request
To create a new application setting, a POST request should be sent to the /api/v1/oms/settings/application_settings/
endpoint.
Here's an example of how to make the request in python:
import requests
import json
url = "https://{instore_url}/api/v1/oms/settings/application_settings/"
token = "f532eXXXXXXXXXXXXXXXXX201XXXXX9332d"
payload = json.dumps({
"key": "ORDER_FILTERING",
"json_value": {
"status": {
"enum": "oms.orders.enums.OrderStatus",
"value": "approved"
},
"channel": [
1
],
"is_send": true
}
})
headers = {
'Content-Type': 'application/json',
'Authorization': 'Token {}'.format(token)
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
Example Response (201 Created)
In a successful response with a status code of 201 Created, the API indicates that a new application setting has been successfully created.The response body contains a JSON object representing the newly created application setting, including its unique ID and any additional information provided during the creation process.
Parameter | Data Type | In | Description |
---|---|---|---|
token | string | header | The API key of the customer account |
key | string | body | The key of the application setting |
json_value | string | body | The json value of the application setting |
This example response serves as a reference to understand the structure and data format returned when a new application setting is created successfully.
{
"id": 36,
"key": "ORDER_FILTERING",
"json_value": {
"status": {
"enum": "oms.orders.enums.OrderStatus",
"value": "approved"
},
"channel": [
1
],
"is_send": true
}
}
Example Response (400 Bad Request)
In an unsuccessful response with a status code of 400 Bad Request, the API indicates that the request could not be processed due to client error. The response body contains a JSON object that provides additional information about the error, including an error message or validation errors.
This example response serves as a reference to understand the structure and data format returned when a request fails due to client error.
{
"error": {
"json_value": {
"is_send": [
"Must be a valid boolean."
]
}
},
"status_code": 400
}
PUT
Update Application Setting
This service is used to update an aplication setting with the request body.
Path: /api/v1/oms/settings/application_settings/{id}/
Request Body
The following request body parameters can be used to update an application setting.
Parameter | Data Type | In | Description |
---|---|---|---|
token | string | header | The API key of the customer account |
json_value | string | body | The json value of the application setting |
Example Request
To update an application setting, a PUT
request should be sent to the /api/v1/oms/settings/application_settings/{id}/
endpoint.
Here's an example of how to make the request in python:
import requests
import json
url = "https://{instore_url}/api/v1/oms/settings/application_settings/{id}/"
token = "f532eXXXXXXXXXXXXXXXXX201XXXXX9332d"
payload = json.dumps({
"json_value": {
"status": {
"enum": "oms.orders.enums.OrderStatus",
"value": "approved"
},
"channel": [
1
],
"is_send": false
}
})
headers = {
'Content-Type': 'application/json',
'Authorization': 'Token {}'.format(token)
}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)
Example Response (200 OK)
In a successful response with a status code of 200 OK, the API indicates that the application setting has been successfully updated. The response body does not contain any messages or json objects.