# Application Settings

Operations related to application settings

## List application settings

> Returns a paginated list of all application settings with optional filtering.\
> The response includes the ID, key, and JSON value for each setting.<br>

```json
{"openapi":"3.0.3","info":{"title":"OMS Base Module API","version":"1.0.0"},"tags":[{"name":"application-settings","description":"Operations related to application settings"}],"servers":[{"url":"https://{domain}/api/v1/oms","variables":{"domain":{"default":"domain.akinon.com"}}}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Use format: `Token <your_token>`"}},"schemas":{"ApplicationSettings":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"Unique identifier for the application setting"},"key":{"type":"string","description":"The key of the application setting"},"json_value":{"type":"object","description":"The value of the application setting, structure depends on the key.\nThis is a dynamic object that follows the schema defined for each setting key.\n"}},"required":["id","key","json_value"]}}},"paths":{"/settings/application_settings/":{"get":{"tags":["application-settings"],"summary":"List application settings","description":"Returns a paginated list of all application settings with optional filtering.\nThe response includes the ID, key, and JSON value for each setting.\n","operationId":"listApplicationSettings","parameters":[{"in":"query","name":"key","schema":{"type":"string"},"description":"Filter settings by key (contains search)"},{"in":"query","name":"page","schema":{"type":"integer","default":1},"description":"Page number for pagination"},{"in":"query","name":"page_size","schema":{"type":"integer","default":10},"description":"Number of items per page"}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer","description":"Total number of settings"},"next":{"type":"string","nullable":true,"description":"URL to the next page of results"},"previous":{"type":"string","nullable":true,"description":"URL to the previous page of results"},"results":{"type":"array","items":{"$ref":"#/components/schemas/ApplicationSettings"}}}}}}}}}}}}
```

## Create a new application setting

> Creates a new application setting with the provided key and value.\
> The value will be validated according to the setting type using registered serializers.\
> \
> If the setting key already exists, the operation will fail.<br>

```json
{"openapi":"3.0.3","info":{"title":"OMS Base Module API","version":"1.0.0"},"tags":[{"name":"application-settings","description":"Operations related to application settings"}],"servers":[{"url":"https://{domain}/api/v1/oms","variables":{"domain":{"default":"domain.akinon.com"}}}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Use format: `Token <your_token>`"}},"schemas":{"ApplicationSettingsCreate":{"type":"object","properties":{"key":{"type":"string","description":"The key of the application setting.\nMust be one of the predefined ApplicationSettingsKey enum values.\n"},"json_value":{"type":"object","description":"The value of the application setting, structure depends on the key.\nThis is a dynamic object that follows the schema defined for each setting key.\n"}},"required":["key","json_value"]},"ValidationError":{"type":"object","properties":{"json_value":{"oneOf":[{"type":"object","description":"Validation errors for the json_value field (for nested fields)"},{"type":"array","description":"Validation errors for the json_value field (general errors)","items":{"type":"string"}}]}}}}},"paths":{"/settings/application_settings/":{"post":{"tags":["application-settings"],"summary":"Create a new application setting","description":"Creates a new application setting with the provided key and value.\nThe value will be validated according to the setting type using registered serializers.\n\nIf the setting key already exists, the operation will fail.\n","operationId":"createApplicationSettings","requestBody":{"description":"Application setting to be created","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplicationSettingsCreate"}}}},"responses":{"201":{"description":"Setting created successfully","headers":{"Location":{"schema":{"type":"string"},"description":"URL to the newly created setting"}}},"400":{"description":"Bad request - validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}}}}}}}
```

## Get a specific application setting

> Returns a specific application setting by ID.\
> The response includes the ID, key, and JSON value for the setting.\
> \
> Note: For security reasons, sensitive information like passwords in the\
> OMNITRON\_CLIENT\_SETTINGS are masked with asterisks.<br>

```json
{"openapi":"3.0.3","info":{"title":"OMS Base Module API","version":"1.0.0"},"tags":[{"name":"application-settings","description":"Operations related to application settings"}],"servers":[{"url":"https://{domain}/api/v1/oms","variables":{"domain":{"default":"domain.akinon.com"}}}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Use format: `Token <your_token>`"}},"schemas":{"ApplicationSettings":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"Unique identifier for the application setting"},"key":{"type":"string","description":"The key of the application setting"},"json_value":{"type":"object","description":"The value of the application setting, structure depends on the key.\nThis is a dynamic object that follows the schema defined for each setting key.\n"}},"required":["id","key","json_value"]}}},"paths":{"/settings/application_settings/{id}/":{"get":{"tags":["application-settings"],"summary":"Get a specific application setting","description":"Returns a specific application setting by ID.\nThe response includes the ID, key, and JSON value for the setting.\n\nNote: For security reasons, sensitive information like passwords in the\nOMNITRON_CLIENT_SETTINGS are masked with asterisks.\n","operationId":"retrieveApplicationSettings","responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplicationSettings"}}}},"404":{"description":"Setting not found"}}}}}}
```

## Update an application setting

> Updates an existing application setting value with validation.\
> The key cannot be changed, only the json\_value can be updated.\
> \
> The value is validated according to the setting type using registered serializers.\
> If the update is successful, a 200 OK response is returned with no body.<br>

```json
{"openapi":"3.0.3","info":{"title":"OMS Base Module API","version":"1.0.0"},"tags":[{"name":"application-settings","description":"Operations related to application settings"}],"servers":[{"url":"https://{domain}/api/v1/oms","variables":{"domain":{"default":"domain.akinon.com"}}}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Use format: `Token <your_token>`"}},"schemas":{"ApplicationSettingsUpdate":{"type":"object","properties":{"json_value":{"type":"object","description":"The new value of the application setting, structure depends on the key.\nThis is a dynamic object that follows the schema defined for each setting key.\n"}},"required":["json_value"]},"ValidationError":{"type":"object","properties":{"json_value":{"oneOf":[{"type":"object","description":"Validation errors for the json_value field (for nested fields)"},{"type":"array","description":"Validation errors for the json_value field (general errors)","items":{"type":"string"}}]}}}}},"paths":{"/settings/application_settings/{id}/":{"put":{"tags":["application-settings"],"summary":"Update an application setting","description":"Updates an existing application setting value with validation.\nThe key cannot be changed, only the json_value can be updated.\n\nThe value is validated according to the setting type using registered serializers.\nIf the update is successful, a 200 OK response is returned with no body.\n","operationId":"updateApplicationSettings","requestBody":{"description":"Updated application setting value","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplicationSettingsUpdate"}}}},"responses":{"200":{"description":"Setting updated successfully"},"400":{"description":"Bad request - validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"404":{"description":"Setting not found"}}}}}}
```

## Get field information for a specific setting

> Returns the field information for a specific setting key.\
> This can be used to build dynamic forms for updating settings.\
> \
> The response includes the field names, types, validation rules, and other\
> metadata that can be used to construct a UI for editing the setting.<br>

```json
{"openapi":"3.0.3","info":{"title":"OMS Base Module API","version":"1.0.0"},"tags":[{"name":"application-settings","description":"Operations related to application settings"}],"servers":[{"url":"https://{domain}/api/v1/oms","variables":{"domain":{"default":"domain.akinon.com"}}}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Use format: `Token <your_token>`"}},"schemas":{"ValidationError":{"type":"object","properties":{"json_value":{"oneOf":[{"type":"object","description":"Validation errors for the json_value field (for nested fields)"},{"type":"array","description":"Validation errors for the json_value field (general errors)","items":{"type":"string"}}]}}}}},"paths":{"/settings/application_settings/settings_fields/":{"get":{"tags":["application-settings"],"summary":"Get field information for a specific setting","description":"Returns the field information for a specific setting key.\nThis can be used to build dynamic forms for updating settings.\n\nThe response includes the field names, types, validation rules, and other\nmetadata that can be used to construct a UI for editing the setting.\n","operationId":"getSettingsFields","parameters":[{"name":"settings_key","in":"query","required":true,"description":"The key of the application setting","schema":{"type":"string","enum":["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","COD_PRODUCT_ENABLED","MIN_ORDER_MODIFIED_DATE","OMNITRON_APPLICATION_ID","CLASS_MAPPING","IS_TRADEIN_ENABLED","AKINON_INVOICER","ALLOWED_PACKAGE_STATES_FOR_RESERVATION","ALLOWED_TRANSFER_STATES_FOR_RESERVATION","PRE_PACKAGE_CLICK_AND_COLLECT","SUPPLIER_CODE","INVENTORY_DISCREPANCY_DAY","MERGE_SAME_LOCATION_PACKAGES","IS_OTP_ENABLED","FORCE_NEW_OOS_PACKAGE","AUTO_RUN_SHIP_THE_PACKAGE_COMMAND","TRANSFER_ORDER_MULTI_ITEM","PREDEFINED_PACKAGE_LOCATIONS","PREDEFINED_PACKAGE_LOCATION_SHIPMENTS","DONOT_REPLAN_SHIPPING_OPTION_GROUPS","SHIPPING_OPTION_GROUPS","CANCEL_RESUME_SAME_LOCATION","OOS_ITEM_MAX_AGE_FOR_CANCELLATION_PLAN","CANCELLATION_REASON_ID_FOR_OOS_CANCELLATION_PLAN"]}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","description":"Field information for the requested setting"}}}},"400":{"description":"Bad request - validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}}}}}}}
```
