Skip to main content

OMS Setup Services

In Omnitron, a setup is a collection of settings used to configure the OMS (Order Management System). This service retrieves these settings from Omnitron and prepares the OMS for its initial configuration.

POST Run OMS Setup

This service is used to run the OMS setup.

Path: /api/v1/oms/oms_setup/

Payload

ParameterData TypeInDescription
usernamestringbodyThe username of the application
passwordstringbodyThe password of the application
auth_tokenstringbodyThe auth token of the application
application_idintbodyThe application ID
user_idintbodyThe user id
oms_urlstringbodyThe oms url
omnitron_urlstringbodyThe omnitron url
load_fixturesboolbodyTo load fixtures set True, not required
whippy_ware_urlstringbodyTo load whippyware set this parameter, not required

Example Request

To run this service, a POST request should be sent to /api/v1/oms/oms_setup/ endpoint. Celery tasks will be triggered to complete the setup tasks.

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

import requests

url = "https://{oms_base_url}/api/v1/oms/oms_setup/"
api_token = "f532eXXXXXXXXXXXXXXXXX201XXXXX9332d"

payload={
"username": "oms_user_124",
"application_id": 124,
"auth_token": "28afd3fa77c37083f1f6e8fbeae312e04e1b2ew",
"password": "A30x0cBhqc",
"user_id": 12,
"omnitron_url": "test-bo.akinon.net",
"oms_url": "https://841407a553684dd781d0f591eed9cb84.lb.akinoncloud.org",
"whippy_ware_url": "https://whippy_ware.lb.akinoncloud.org"
}
headers = {
'Accept': 'application/json',
'Authorization': 'Token {}'.format(api_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 response body does not contain any objects or messages.

GET Query OMS Setup Status

This service is used to check the status of the "OMS Setup" and whether it has been completed or not.

Path: /api/v1/oms/is_setup_completed/

Example Request

To retreive information about status of the OMS Setup, a GET request shoud be sent. No parameters are required.

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

import requests

url = "https://{oms_base_url}/api/v1/oms/is_setup_completed/"
api_token = "f532eXXXXXXXXXXXXXXXXX201XXXXX9332d"

headers = {
'Accept': 'application/json',
'Authorization': 'Token {}'.format(api_token)
}

response = requests.request("GET", url, headers=headers)

print(response.text)

Example Response (200 OK)

If the OMS Setup has been completed, it will return a successful response with a status code of 200 OK.

ParameterData TypeDescription
is_task_completedboolStatus of the OMS setup tasks
contextobjectDetail of the each setup task status