> For the complete documentation index, see [llms.txt](https://apidocs.akinon.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidocs.akinon.com/oms/address-setup-services.md).

# Address Setup Services

All services related to address setup are listed in this page.

### `POST` Execute

This endpoint is used for adding countries, cities, townships, and districts that exist in Omnitron but are not currently present in the OMS database.

**Path:** `/api/v1/oms/setup/addresses/execute/`

**Request Body**

The following query parameters can be used to execute the setup.

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

**Example Request**

To execute this setup step, a `POST` request should be sent to the `/api/v1/oms/setup/addresses/execute/` 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/setup/addresses/execute/"
token = "f532eXXXXXXXXXXXXXXXXX201XXXXX9332d"

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

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

print(response.status_code)

```

**Response 204 No Content**

There is No Response.

### `GET` Get Async Status

This endpoint provides the status of the task executed by the "execute" endpoint. If there is no active task, the result will be returned as "READY."

**Path:** `/api/v1/oms/setup/addresses/get_async_status/`

**Request Body**

The following query parameters can be used to view the status of the setup task.

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

**Example Request**

To view the status of the task, a `GET` request should be sent to the `/api/v1/oms/setup/addresses/get_async_status/` 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/setup/addresses/get_async_status/"
token = "f532eXXXXXXXXXXXXXXXXX201XXXXX9332d"

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

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

print(response.json())

```

**Response 200 OK**

Possible values of result are:

* READY
* WORKING
* FINISHED
* FAILED
* ABORTED

| Parameter | Data Type | Description            |
| --------- | --------- | ---------------------- |
| reuslt    | string    | The status of the task |

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

```json
{
  "result": "Ready"
}
```

### `GET` Is Required

This endpoint indicates whether the "execute" endpoint should be called or not. It returns "true" if there are any countries, cities, townships, or districts in Omnitron that are not present in OMS.

**Path:** `/api/v1/oms/setup/addresses/is_required/`

**Request Body**

The following query parameters can be used to execute the setup.

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

**Example Request**

To execute this setup step, a `POST` request should be sent to the `/api/v1/oms/setup/addresses/is_required/` 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/setup/addresses/is_required/"
token = "f532eXXXXXXXXXXXXXXXXX201XXXXX9332d"

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

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

print(response.status_code)

```

**Response 200 OK**

Possible values of result are true and false.

| Parameter | Data Type | Description                           |
| --------- | --------- | ------------------------------------- |
| result    | string    | Whether the task should be run or not |

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

```json
{
  "result": "true"
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://apidocs.akinon.com/oms/address-setup-services.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
