# Stock Location Services

All services related to stock\_locations are listed in this document.

### `GET` StockLocation List - Simple

Returns all stock\_location with detailed information. It is added for business intelligence purposes.

**Path:** `/api/v1/oms/stocklocations/list-simple/`

**Query Parameters**

The following query parameters can be used to get the details of stock\_locations.

| Parameter | Data Type | In     | Description                         |
| --------- | --------- | ------ | ----------------------------------- |
| token     | string    | header | The API key of the customer account |

**Example Request**

To get a detailed list of all stock\_locations, a `GET` request should be sent to\
the `/api/v1/oms/stocklocations/list-simple/` endpoint. In the headers,\
set the `Authorization` header to include the token for authentication.

Here's an example of how to make the request in python:

```python
import requests

url = "https://{domain_url}/api/v1/oms/stocklocations/list-simple/"
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\
details of the stock\_locations. The response body contains a `JSON` object with\
the stock\_locations and their attributes such as ID, name etc.

These parameters are described in the following table.

| Parameter                     | Data Type | Description                                              |
| ----------------------------- | --------- | -------------------------------------------------------- |
| id                            | integer   | The primary key of the stock\_location                   |
| created\_date                 | date      | The creation date of the stock\_location                 |
| modified\_date                | date      | The last modified date of the stock\_location            |
| omnitron\_id                  | integer   | The Omnitron ID of the stock\_location                   |
| name                          | string    | The name of the stock\_location                          |
| stock\_location\_type         | string    | The stock\_location\_type of the stock\_location         |
| fax\_number                   | string    | The fax number of the stock\_location                    |
| erp\_code                     | string    | The partner stock\_location code                         |
| address                       | integer   | The address id of the stock\_location                    |
| is\_fulfillment\_center       | boolean   | The is\_fulfillment\_center of the stock\_location       |
| is\_pickup\_location          | boolean   | The is\_pickup\_location of the stock\_location          |
| is\_delivery\_location        | boolean   | The is\_delivery\_location of the stock\_location        |
| is\_fast\_delivery\_available | boolean   | The is\_fast\_delivery\_available of the stock\_location |
| is\_return\_available         | boolean   | The is\_return\_available of the stock\_location         |
| is\_active                    | boolean   | The status of the stock\_location                        |
| priority                      | integer   | The priority of the stock\_location                      |
| conf                          | dict      | The configuration info of the stock\_location            |
| daytime\_phone                | string    | The daytime\_phone of the stock\_location                |
| evening\_phone                | string    | The evening\_phone of the stock\_location                |
| email                         | string    | The email of the stock\_location                         |
| target\_packing\_interval     | string    | The packing interval of the stock\_location              |
| target\_transfer\_interval    | string    | The transfer interval of the stock\_location             |
| use\_as\_shipper\_location    | boolean   | The shipper location info of the stock\_location         |
| quota                         | integer   | The quota amount of the stock\_location                  |
| max\_quota                    | integer   | The max\_quota amount of the stock\_location             |
| engine                        | integer   | The stock engine of the stock\_location                  |
| tags                          | list      | The tags of the stock\_location                          |

#### Max Quota & Quota Feature

**Regardless of scenarios, the process of lowering and raising quotas continues, the quota amount continues to increase and decrease on a location basis. However, for these alterations to impact planning, the scenario rules must have the SELECT\_BY\_QUOTA value.**

* The maximum quota value specifies how many packages can be created from the respective location. The quota value is a user-unspecified parameter used for monitoring the maximum quota value and performing increase or decrease operations.
* max\_quota - quota = available\_quota
* If the available\_quota value is 0, no packages can be created. (To encounter this scenario, the SELECT\_BY\_QUOTA value must be chosen in the scenario rules.)
* For packages with a status below 400 and in the cancellation\_waiting state, the quota value increases by 1. (During this stage, when the package is in the waiting state, the quota amount is considered to increase by 1.)
* Upon packaging a package, the quota value decreases by 1. Consequently, the available\_quota increases, enhancing the likelihood of packaging from the respective location.
* In the event of a package cancellation, the quota amount decreases by 1 in a similar way.

**How to Set Max\_quota Condition**

* Navigate to Akinon OMS > Locations > x location: Enter the desired max\_quota value in the max\_quota field.
* Navigate to Akinon OMS > Scenarios > Distribution Scenario > Rules > StockLocation Conditions: Ensure SELECT\_BY\_QUOTA is selected.
  * Once these steps are executed, the packaging process will factor in the max\_quota amount.
  * After establishing this condition, it is crucial to note that the packaging process will occur based on the max\_quota value.
  * In case of misuse, the packaging process may not occur. (For instance, if max\_quota values are not entered for locations, and there is only one rule in the scenario with a quota condition, the packaging process will not occur.)

This example response serves as a reference to understand the structure and data format returned from this API service.

```json
{
    "count": 12,
    "next": "https://{domain-url}/api/v1/oms/stocklocations/list-simple/?page=2",
    "previous": null,
    "results": [
        {
            "id": 199,
            "stock_location_type": "warehouse",
            "created_date": "2023-01-01T11:52:39.635358Z",
            "modified_date": "2023-12-01T09:14:24.129494Z",
            "omnitron_id": null,
            "name": "Name",
            "is_fulfillment_center": true,
            "is_pickup_location": false,
            "is_delivery_location": true,
            "is_return_available": false,
            "is_fast_delivery_available": false,
            "is_active": false,
            "priority": 1,
            "conf": {},
            "daytime_phone": null,
            "evening_phone": null,
            "fax_number": null,
            "email": "email@akinon.com",
            "target_packing_interval": "5 00:00:00",
            "target_transfer_interval": "3 00:00:00",
            "erp_code": "erp_code",
            "use_as_shipper_location": false,
            "quota": 0,
            "max_quota": 100,
            "engine": 100,
            "address": 1,
            "tags": []
        }
    ]
}
```

### `OPTIONS` StockLocation List - Simple

Returns API level details of StockLocation List Simple service.

**Path:** `/api/v1/oms/stocklocations/list-simple/`

**Query Parameters**

The following query parameters can be used to get the details of the service.

| Parameter | Data Type | In     | Description                         |
| --------- | --------- | ------ | ----------------------------------- |
| token     | string    | header | The API key of the customer account |

**Example Request**

To get API level details of the service, a `OPTIONS` request should be sent to\
the `/api/v1/oms/stocklocations/list-simple/` endpoint. In the headers,\
set the `Authorization` header to include the token for authentication.

Here's an example of how to make the request in python:

```python
import requests

url = "https://{domain_url}/api/v1/oms/stocklocations/list-simple/"
token = "f532eXXXXXXXXXXXXXXXXX201XXXXX9332d"

headers = {
    'Content-Type': 'application/json',
    'Authorization': f'Token {token}'
}

response = requests.request('OPTIONS', url, headers=headers)

print(response.json())

```

**Example Response (200 OK)**

In a successful response with a status code of `200 OK`, it returns the\
API level details of the service. The response body contains a `JSON` object\
with the name, rendering types, filtering attributes etc.

These parameters are described in the following table.

| Parameter | Data Type | Description                             |
| --------- | --------- | --------------------------------------- |
| name      | string    | The name of the service                 |
| renders   | list      | The rendering types of the service      |
| parses    | list      | The parsing types of the service        |
| actions   | json      | The defined actions of the service      |
| filters   | list      | The filtering attributes of the service |

This example response serves as a reference to understand the structure and data format returned from this API service.

```json
{
    "name": "list-simple",
    "renders": [
        "application/json",
        "text/csv",
        "application/xls"
    ],
    "parses": [
        "application/json",
        "application/x-www-form-urlencoded",
        "multipart/form-data"
    ],
    "actions": {
        "GET": {
            "id": {
                "type": "integer",
                "required": false,
                "read_only": true,
                "label": "ID"
            },
            "stock_location_type": {
                "type": "choice",
                "required": true,
                "read_only": false,
                "label": "Stock location type",
                "choices": [
                    {
                        "value": "store",
                        "display_name": "Store"
                    },
                    {
                        "value": "warehouse",
                        "display_name": "Warehouse"
                    }
                ]
            },
            "created_date": {
                "type": "datetime",
                "required": false,
                "read_only": true,
                "label": "Created date"
            },
            "modified_date": {
                "type": "datetime",
                "required": false,
                "read_only": true,
                "label": "Modified date"
            },
            "omnitron_id": {
                "type": "integer",
                "required": false,
                "read_only": false,
                "label": "Omnitron id",
                "min_value": -2147483648,
                "max_value": 2147483647
            },
            "name": {
                "type": "string",
                "required": true,
                "read_only": false,
                "label": "Stock Location Name",
                "max_length": 128
            },
            "is_fulfillment_center": {
                "type": "boolean",
                "required": false,
                "read_only": false,
                "label": "Is fulfillment center"
            },
            "is_pickup_location": {
                "type": "boolean",
                "required": false,
                "read_only": false,
                "label": "Is pickup location"
            },
            "is_delivery_location": {
                "type": "boolean",
                "required": false,
                "read_only": false,
                "label": "Is delivery location"
            },
            "is_return_available": {
                "type": "boolean",
                "required": false,
                "read_only": false,
                "label": "Is return available"
            },
            "is_fast_delivery_available": {
                "type": "boolean",
                "required": false,
                "read_only": false,
                "label": "Is fast delivery available"
            },
            "is_active": {
                "type": "boolean",
                "required": false,
                "read_only": false,
                "label": "Is active"
            },
            "priority": {
                "type": "integer",
                "required": true,
                "read_only": false,
                "label": "Priority",
                "min_value": 0,
                "max_value": 32767
            },
            "conf": {
                "type": "json",
                "required": false,
                "read_only": false,
                "label": "Conf"
            },
            "daytime_phone": {
                "type": "string",
                "required": false,
                "read_only": false,
                "label": "Daytime Phone Number",
                "max_length": 60
            },
            "evening_phone": {
                "type": "string",
                "required": false,
                "read_only": false,
                "label": "Evening Time Phone Number",
                "max_length": 60
            },
            "fax_number": {
                "type": "string",
                "required": false,
                "read_only": false,
                "label": "Fax Number",
                "max_length": 60
            },
            "email": {
                "type": "email",
                "required": false,
                "read_only": false,
                "label": "Email Address",
                "max_length": 254
            },
            "target_packing_interval": {
                "type": "field",
                "required": false,
                "read_only": false,
                "label": "Target packing interval"
            },
            "target_transfer_interval": {
                "type": "field",
                "required": false,
                "read_only": false,
                "label": "Target transfer interval"
            },
            "erp_code": {
                "type": "string",
                "required": true,
                "read_only": false,
                "label": "ERP Code",
                "max_length": 32
            },
            "use_as_shipper_location": {
                "type": "boolean",
                "required": false,
                "read_only": false,
                "label": "Use as shipper location"
            },
            "quota": {
                "type": "integer",
                "required": false,
                "read_only": false,
                "label": "Quota",
                "min_value": -2147483648,
                "max_value": 2147483647
            },
            "max_quota": {
                "type": "integer",
                "required": false,
                "read_only": false,
                "label": "Max quota",
                "min_value": -2147483648,
                "max_value": 2147483647
            },
            "engine": {
                "type": "pk field",
                "required": false,
                "read_only": false,
                "label": "Engine"
            },
            "address": {
                "type": "pk field",
                "required": true,
                "read_only": false,
                "label": "Address"
            },
            "tags": {
                "type": "field",
                "required": false,
                "read_only": false,
                "label": "Tags"
            }
        }
    },
    "filters": [
        {
            "label": "Name",
            "field_name": "name",
            "type": "string",
            "lookup_expr": [
                "icontains"
            ],
            "extra": {
                "required": false
            }
        },
        {
            "label": "Erp Code",
            "field_name": "erp_code",
            "type": "string",
            "lookup_expr": [
                "exact"
            ],
            "extra": {
                "required": false
            }
        },
        {
            "label": "City",
            "field_name": "address__city",
            "type": "integer",
            "lookup_expr": [
                "exact"
            ],
            "extra": {
                "required": false
            }
        },
        {
            "label": "Township",
            "field_name": "address__township",
            "type": "integer",
            "lookup_expr": [
                "exact"
            ],
            "extra": {
                "required": false
            }
        },
        {
            "label": "Tag",
            "field_name": "tags__name",
            "type": "string",
            "lookup_expr": [
                "exact"
            ],
            "extra": {
                "required": false
            }
        },
        {
            "label": "Stock Location Type",
            "field_name": "stock_location_type",
            "type": "dropdown",
            "lookup_expr": [
                "exact"
            ],
            "extra": {
                "choices": [
                    [
                        "store",
                        "Store"
                    ],
                    [
                        "warehouse",
                        "Warehouse"
                    ]
                ],
                "required": false
            }
        },
        {
            "label": "Retail Store Erp Code",
            "field_name": "erp_code",
            "type": "string",
            "lookup_expr": [
                "exact"
            ],
            "extra": {
                "required": false
            }
        },
        {
            "label": "Id In",
            "field_name": "id",
            "type": "integer",
            "lookup_expr": [
                "in"
            ],
            "extra": {
                "help_text": "Multiple values may be separated by commas.",
                "required": false
            }
        },
        {
            "label": "Id Gt",
            "field_name": "id",
            "type": "integer",
            "lookup_expr": [
                "gt"
            ],
            "extra": {
                "required": false
            }
        },
        {
            "label": "Id Gte",
            "field_name": "id",
            "type": "integer",
            "lookup_expr": [
                "gte"
            ],
            "extra": {
                "required": false
            }
        },
        {
            "label": "Id Lt",
            "field_name": "id",
            "type": "integer",
            "lookup_expr": [
                "lt"
            ],
            "extra": {
                "required": false
            }
        },
        {
            "label": "Id Lte",
            "field_name": "id",
            "type": "integer",
            "lookup_expr": [
                "lte"
            ],
            "extra": {
                "required": false
            }
        },
        {
            "label": "Sort",
            "field_name": "sort",
            "type": "dropdown",
            "lookup_expr": [
                "exact"
            ],
            "extra": {
                "choices": [
                    [
                        "id",
                        "ID"
                    ],
                    [
                        "-id",
                        "ID (descending)"
                    ],
                    [
                        "modified_date",
                        "Modified Date"
                    ],
                    [
                        "-modified_date",
                        "Modified Date (descending)"
                    ],
                    [
                        "name",
                        "Name"
                    ],
                    [
                        "-name",
                        "Name (descending)"
                    ]
                ],
                "help_text": "",
                "null_label": null,
                "required": false
            }
        },
        {
            "label": "Is Active",
            "field_name": "is_active",
            "type": "string",
            "lookup_expr": [
                "exact"
            ],
            "extra": {
                "required": false
            }
        },
        {
            "label": "Is Fulfillment Center",
            "field_name": "is_fulfillment_center",
            "type": "string",
            "lookup_expr": [
                "exact"
            ],
            "extra": {
                "required": false
            }
        },
        {
            "label": "Is Pickup Location",
            "field_name": "is_pickup_location",
            "type": "string",
            "lookup_expr": [
                "exact"
            ],
            "extra": {
                "required": false
            }
        },
        {
            "label": "Is Delivery Location",
            "field_name": "is_delivery_location",
            "type": "string",
            "lookup_expr": [
                "exact"
            ],
            "extra": {
                "required": false
            }
        },
        {
            "label": "Is Return Available",
            "field_name": "is_return_available",
            "type": "string",
            "lookup_expr": [
                "exact"
            ],
            "extra": {
                "required": false
            }
        },
        {
            "label": "Is Fast Delivery Available",
            "field_name": "is_fast_delivery_available",
            "type": "string",
            "lookup_expr": [
                "exact"
            ],
            "extra": {
                "required": false
            }
        },
        {
            "label": "Created Date",
            "field_name": "created_date",
            "type": "string",
            "lookup_expr": [
                "gt",
                "gte",
                "lt",
                "lte"
            ],
            "extra": {
                "required": false
            }
        },
        {
            "label": "Modified Date",
            "field_name": "modified_date",
            "type": "string",
            "lookup_expr": [
                "gt",
                "gte",
                "lt",
                "lte"
            ],
            "extra": {
                "required": false
            }
        },
        {
            "label": "Engine Id",
            "field_name": "engine__id",
            "type": "string",
            "lookup_expr": [
                "exact"
            ],
            "extra": {
                "required": false
            }
        }
    ]
}
```

### `GET` StockLocation List

Returns API level details of StockLocation List service.

**Path:** `/api/v1/oms/stocklocations/`

**Query Parameters**

The following query parameters can be used to get the details of the service.

| Parameter | Data Type | In     | Description                         |
| --------- | --------- | ------ | ----------------------------------- |
| token     | string    | header | The API key of the customer account |

**Example Request**

To get API level details of the service, a `GET` request should be sent to\
the `/api/v1/oms/stocklocations/` endpoint. In the headers,\
set the `Authorization` header to include the token for authentication.

Here's an example of how to make the request in python:

```python
import requests

url = "https://{domain_url}/api/v1/oms/stocklocations/"
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)**

This example response serves as a reference to understand the structure and data format returned from this API service.

```json
{
    "count": 12,
    "next": "https://{domain_url}/api/v1/oms/stocklocations/?page=2",
    "previous": null,
    "results": [
        {
            "id": 199,
            "stock_location_type": "warehouse",
            "address": {
                "id": 199,
                "mapping": null,
                "country": {
                    "omnitron_id": 1,
                    "pk": 1,
                    "name": "Country Name",
                    "code": "Country Code",
                    "is_active": true,
                    "longitude": "35.30207500",
                    "latitude": "39.05625600"
                },
                "city": {
                    "omnitron_id": 7,
                    "pk": 7,
                    "name": "city name",
                    "country": 1,
                    "is_active": true,
                    "longitude": "32.85404900",
                    "latitude": "39.92076300"
                },
                "township": {
                    "omnitron_id": 88,
                    "pk": 68,
                    "name": "township name",
                    "city": 7,
                    "is_active": true,
                    "longitude": "32.58453600",
                    "latitude": "39.95817300"
                },
                "district": {
                    "omnitron_id": 6426,
                    "pk": 5305,
                    "name": "district name",
                    "city": 7,
                    "township": 68,
                    "is_active": true,
                    "longitude": null,
                    "latitude": null
                },
                "title": "Address Title",
                "is_active": true,
                "line": "address line",
                "postcode": null,
                "notes": null,
                "longitude": "0.20000000",
                "latitude": "0.10000000"
            },
            "engine": 100,
            "tags": [],
            "created_date": "2023-01-06T11:52:39.635358Z",
            "modified_date": "2023-12-11T09:14:24.129494Z",
            "omnitron_id": null,
            "name": "name",
            "is_fulfillment_center": false,
            "is_pickup_location": false,
            "is_delivery_location": true,
            "is_return_available": false,
            "is_fast_delivery_available": false,
            "is_active": false,
            "priority": 1,
            "conf": {},
            "daytime_phone": null,
            "evening_phone": null,
            "fax_number": null,
            "email": "email@akinon.com",
            "target_packing_interval": "5 00:00:00",
            "target_transfer_interval": "3 00:00:00",
            "erp_code": "erp_code",
            "use_as_shipper_location": false,
            "quota": 0,
            "max_quota": 5
        }
    ]
}
```

### `GET` StockLocation Detail

Returns API level details of StockLocation Detail service.

**Path:** `/api/v1/oms/stocklocations/<id>`

**Query Parameters**

The following query parameters can be used to get the details of the service.

| Parameter | Data Type | In     | Description                         |
| --------- | --------- | ------ | ----------------------------------- |
| token     | string    | header | The API key of the customer account |

**Example Request**

To get API level details of the service, a `GET` request should be sent to\
the `/api/v1/oms/stocklocations/<id>` endpoint. In the headers,\
set the `Authorization` header to include the token for authentication.

Here's an example of how to make the request in python:

```python
import requests

url = "https://{domain_url}/api/v1/oms/stocklocations/<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)**

This example response serves as a reference to understand the structure and data format returned from this API service.

```json
{
  "id": 199,
  "stock_location_type": "warehouse",
  "address": {
    "id": 199,
    "mapping": null,
    "country": {
      "omnitron_id": 1,
      "pk": 1,
      "name": "Country Name",
      "code": "Country Code",
      "is_active": true,
      "longitude": "35.30207500",
      "latitude": "39.05625600"
    },
    "city": {
      "omnitron_id": 7,
      "pk": 7,
      "name": "city name",
      "country": 1,
      "is_active": true,
      "longitude": "32.85404900",
      "latitude": "39.92076300"
    },
    "township": {
      "omnitron_id": 88,
      "pk": 68,
      "name": "township name",
      "city": 7,
      "is_active": true,
      "longitude": "32.58453600",
      "latitude": "39.95817300"
    },
    "district": {
      "omnitron_id": 6426,
      "pk": 5305,
      "name": "district name",
      "city": 7,
      "township": 68,
      "is_active": true,
      "longitude": null,
      "latitude": null
    },
    "title": "Address Title",
    "is_active": true,
    "line": "address line",
    "postcode": null,
    "notes": null,
    "longitude": "0.20000000",
    "latitude": "0.10000000"
  },
  "engine": 100,
  "tags": [],
  "created_date": "2023-01-06T11:52:39.635358Z",
  "modified_date": "2023-12-11T09:14:24.129494Z",
  "omnitron_id": null,
  "name": "name",
  "is_fulfillment_center": false,
  "is_pickup_location": false,
  "is_delivery_location": true,
  "is_return_available": false,
  "is_fast_delivery_available": false,
  "is_active": false,
  "priority": 1,
  "conf": {},
  "daytime_phone": null,
  "evening_phone": null,
  "fax_number": null,
  "email": "email@akinon.com",
  "target_packing_interval": "5 00:00:00",
  "target_transfer_interval": "3 00:00:00",
  "erp_code": "erp_code",
  "use_as_shipper_location": false,
  "quota": 0,
  "max_quota": 5
}
```

### `POST` StockLocation Create

Returns API level details of StockLocation Create service.

**Path:** `/api/v1/oms/stocklocations/`

**Query Parameters**

The following query parameters can be used to get the details of the service.

| Parameter | Data Type | In     | Description                         |
| --------- | --------- | ------ | ----------------------------------- |
| token     | string    | header | The API key of the customer account |

**Example Request**

To get API level details of the service, a `POST` request should be sent to\
the `/api/v1/oms/stocklocations/<id>` endpoint. In the headers,\
set the `Authorization` header to include the token for authentication.

Here's an example of how to make the request in python:

```python
import requests

url = "https://{domain_url}/api/v1/oms/stocklocations/"
token = "f532eXXXXXXXXXXXXXXXXX201XXXXX9332d"

payload = {
  "stock_location_type": "Warehouse",
  "address": {
    "mapping": {},
    "title": "Warehouse Address",
    "is_active": True,
    "line": "test line.",
    "postcode": "",
    "notes": "",
    "longitude": "11.0000000",
    "latitude": "11.0000000",
    "country": 1,
    "city": 1,
    "township": 1,
    "district": 1
  },
  "created_date": "2024-03-20T07:01:19.108556Z",
  "modified_date": "2024-03-20T07:01:19.108556Z",
  "name": "Inventory Name",
  "is_fulfillment_center": True,
  "is_pickup_location": True,
  "is_delivery_location": True,
  "is_return_available": False,
  "is_fast_delivery_available": False,
  "mapping": {},
  "priority": 1,
  "conf": {
    "foo": "bar"
  },
  "daytime_phone": "123456",
  "evening_phone": "987654",
  "fax_number": "",
  "email": "foo@bar.com",
  "target_packing_interval": "5 00:00:00",
  "target_transfer_interval": "3 00:00:00",
  "erp_code": "erp_code",
  "tags": [],
  "max_quota": 100  
}
headers = {
    'Content-Type': 'application/json',
    'Authorization': f'Token {token}'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.json())

```

**Example Response (201 Created)**

This example response serves as a reference to understand the structure and data format returned from this API service.

```json
{
    "id": 1,
    "stock_location_type": "Warehouse",
    "address": {
        "id": 1,
        "township": 1,
        "mapping": {},
        "title": "Warehouse Address",
        "is_active": true,
        "line": "test line.",
        "postcode": "",
        "notes": "",
        "longitude": "11.00000000",
        "latitude": "11.00000000",
        "country": 1,
        "city": 1,
        "district": 1
    },
    "engine": null,
    "tags": [],
    "created_date": "2023-12-26T07:50:05.055342Z",
    "modified_date": "2023-12-26T07:50:05.055359Z",
    "omnitron_id": null,
    "name": "Inventory Name",
    "is_fulfillment_center": false,
    "is_pickup_location": true,
    "is_delivery_location": true,
    "is_return_available": false,
    "is_fast_delivery_available": false,
    "is_active": false,
    "priority": 1,
    "daytime_phone": "123456",
    "evening_phone": "987654",
    "fax_number": "",
    "email": "foo@bar.com",
    "target_packing_interval": "5 00:00:00",
    "target_transfer_interval": "3 00:00:00",
    "erp_code": "erp_code",
    "use_as_shipper_location": false,
    "quota": 0,
    "max_quota": 100
}
```

### `PUT` StockLocation Update

Returns API level details of StockLocation Update service.

**Path:** `/api/v1/oms/stocklocations/<id>`

**Query Parameters**

The following query parameters can be used to get the details of the service.

| Parameter | Data Type | In     | Description                         |
| --------- | --------- | ------ | ----------------------------------- |
| token     | string    | header | The API key of the customer account |

**Example Request**

To get API level details of the service, a `PUT` request should be sent to\
the `/api/v1/oms/stocklocations/<id>` endpoint. In the headers,\
set the `Authorization` header to include the token for authentication.

Here's an example of how to make the request in python:

```python
import requests

url = "https://{domain_url}/api/v1/oms/stocklocations/<id>"
token = "f532eXXXXXXXXXXXXXXXXX201XXXXX9332d"

payload = {
  "stock_location_type": "Warehouse",
  "address": {
    "mapping": {},
    "title": "Warehouse Address",
    "is_active": True,
    "line": "test line.",
    "postcode": "",
    "notes": "",
    "longitude": "11.0000000",
    "latitude": "11.0000000",
    "country": 1,
    "city": 1,
    "township": 1,
    "district": 1
  },
  "created_date": "2024-03-20T07:01:19.108556Z",
  "modified_date": "2024-03-20T07:01:19.108556Z",
  "name": "Inventory Name",
  "is_fulfillment_center": True,
  "is_pickup_location": True,
  "is_delivery_location": True,
  "is_return_available": False,
  "is_fast_delivery_available": False,
  "mapping": {},
  "priority": 1,
  "conf": {
    "foo": "bar"
  },
  "daytime_phone": "123456",
  "evening_phone": "987654",
  "fax_number": "",
  "email": "foo@bar.com",
  "target_packing_interval": "5 00:00:00",
  "target_transfer_interval": "3 00:00:00",
  "erp_code": "erp_code",
  "tags": [],
  "max_quota": 100  
}
headers = {
    'Content-Type': 'application/json',
    'Authorization': f'Token {token}'
}

response = requests.request("PUT", url, headers=headers, data=payload)

print(response.json())

```

**Example Response (200 OK)**

This example response serves as a reference to understand the structure and data format returned from this API service.

```json
{
    "id": 298,
    "stock_location_type": "store",
    "address": {
        "id": 364,
        "city": {
            "omnitron_id": 1,
            "pk": 1,
            "name": "name",
            "country": 1,
            "is_active": true,
            "longitude": "35.31945700",
            "latitude": "37.00294000"
        },
        "country": {
            "omnitron_id": 1,
            "pk": 1,
            "name": "Country Name",
            "code": "Country Code",
            "is_active": true,
            "longitude": "35.30207500",
            "latitude": "39.05625600"
        },
        "township": {
            "omnitron_id": 15,
            "pk": 1,
            "name": "name",
            "city": 1,
            "is_active": true,
            "longitude": null,
            "latitude": null
        },
        "district": {
            "omnitron_id": 832,
            "pk": 1,
            "name": "name",
            "city": 1,
            "township": 1,
            "is_active": true,
            "longitude": null,
            "latitude": null
        },
        "mapping": {},
        "title": "Warehouse Address",
        "is_active": true,
        "line": "test line.",
        "postcode": "",
        "notes": "",
        "longitude": "11.00000000",
        "latitude": "11.00000000"
    },
    "engine": null,
    "tags": [],
    "created_date": "2023-12-26T07:50:05.055342Z",
    "modified_date": "2023-12-26T07:50:05.055359Z",
    "omnitron_id": null,
    "name": "Name",
    "is_fulfillment_center": false,
    "is_pickup_location": true,
    "is_delivery_location": true,
    "is_return_available": false,
    "is_fast_delivery_available": false,
    "is_active": false,
    "priority": 1,
    "conf": {
        "foo": "bar"
    },
    "daytime_phone": "123456",
    "evening_phone": "987654",
    "fax_number": "",
    "email": "foo@bar.com",
    "target_packing_interval": "5 00:00:00",
    "target_transfer_interval": "3 00:00:00",
    "erp_code": "erp_code",
    "use_as_shipper_location": false,
    "quota": 0,
    "max_quota": 0
}
```

### `PATCH` StockLocation Patch

Returns API level details of StockLocation Patch service.

**Path:** `/api/v1/oms/stocklocations/<id>`

**Query Parameters**

The following query parameters can be used to get the details of the service.

| Parameter | Data Type | In     | Description                         |
| --------- | --------- | ------ | ----------------------------------- |
| token     | string    | header | The API key of the customer account |

**Example Request**

To get API level details of the service, a `PATCH` request should be sent to\
the `/api/v1/oms/stocklocations/<id>` endpoint. In the headers,\
set the `Authorization` header to include the token for authentication.

Here's an example of how to make the request in python:

```python
import requests

url = "https://{domain_url}/api/v1/oms/stocklocations/<id>"
token = "f532eXXXXXXXXXXXXXXXXX201XXXXX9332d"

payload = {
  "stock_location_type": "Warehouse",
  "max_quota": 1000,
  ...
}
headers = {
    'Content-Type': 'application/json',
    'Authorization': f'Token {token}'
}

response = requests.request("PATCH", url, headers=headers, data=payload)

print(response.json())

```

**Example Response (200 OK)**

This example response serves as a reference to understand the structure and data format returned from this API service.

```json
{
    "id": 298,
    "stock_location_type": "Warehouse",
    "address": {
        "id": 364,
        "township": 1,
        "mapping": {},
        "title": "Warehouse Address",
        "is_active": true,
        "line": "test line.",
        "postcode": "",
        "notes": "",
        "longitude": "11.00000000",
        "latitude": "11.00000000",
        "country": 1,
        "city": 1,
        "district": 1
    },
    "engine": null,
    "tags": [],
    "created_date": "2023-12-26T07:50:05.055342Z",
    "modified_date": "2023-12-26T09:45:45.156862Z",
    "omnitron_id": null,
    "name": "Name",
    "is_fulfillment_center": false,
    "is_pickup_location": true,
    "is_delivery_location": true,
    "is_return_available": false,
    "is_fast_delivery_available": false,
    "is_active": false,
    "priority": 1,
    "daytime_phone": "123456",
    "evening_phone": "987654",
    "fax_number": "",
    "email": "foo@bar.com",
    "target_packing_interval": "5 00:00:00",
    "target_transfer_interval": "3 00:00:00",
    "erp_code": "erp_code",
    "use_as_shipper_location": false,
    "quota": 0,
    "max_quota": 1000
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://apidocs.akinon.com/oms/stock-location-services.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
