# Integrating OMS with Seller Center

This document provides information on how to integrate and configure the OMS (Order Management System) with the Seller Center.

## <mark style="color:red;">Overview of OMS–Seller Center Integration</mark>

The OMS-Seller Center integration allows seamless communication between the OMS and the Seller Center. Through this integration, orders flow through the Seller Center instead of Omnitron, and both orders and their related packages are managed via the OMS.

Only order and address data are transmitted from the Seller Center as part of this integration. OMS’s other dependencies on Omnitron remain intact.

A high-level architecture diagram for the integration is provided below.

<figure><img src="https://2911598027-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlQinVPnOffBiOp126ldR%2Fuploads%2Fgit-blob-c83b4c7e07aa099d6fe53b6c52a34ac9c832fe9b%2Fimage1.png?alt=media" alt=""><figcaption></figcaption></figure>

## <mark style="color:red;">Integration Setup Process</mark>

{% stepper %}
{% step %} <mark style="color:red;">**Deactivating Omnitron Webhooks**</mark>

During the setup, automatically registered webhooks in Omnitron must be deactivated.

You can access the webhooks using the following endpoint:

```bash
{base_url}/api/v1/whisperer/hooks/?limit=999
```

The following webhooks should be deactivated:

* `cancellation_plan.created`
* `cancellation_plan.updated`
* `order.created`
* `order.updated`
* `retail_store.created`
* `retail_store.updated`
  {% endstep %}

{% step %} <mark style="color:red;">**Configuring OMS Application Settings for Seller Center Integration**</mark>

To enable integration, endpoints normally used for order flows with Omnitron must be redirected to the Seller Center. This redirection is achieved by updating the relevant configurations in the **OMS Application Settings**.

**Configuration Key:**\
`OMNITRON_CLIENT_SETTINGS`

```json
{
  "key": "OMNITRON_CLIENT_SETTINGS",
  "json_value": {
    "auth": {
      "username": "username",
      "password": "password"
    },
    "urls": {
      "oms_url": "{base_url}/api/v1",
      "base_url": "{base_url}/api/v1"
    },
    "timeouts": {
      "read": 6000,
      "connect": 6000
    },
    "endpoint_conf": [
      {
        "endpoint": "order_item_bulk_update",
        "base_url": "{base_url}/api/v1/applications/oms",
        "auth": { "token": "your_token_here" }
      },
      {
        "endpoint": "orders",
        "base_url": "{base_url}/api/v1/applications/oms",
        "auth": { "token": "your_token_here" }
      },
      {
        "endpoint": "orderitem_set",
        "base_url": "{base_url}/api/v1/applications/oms",
        "auth": { "token": "your_token_here" }
      },
      {
        "endpoint": "cancellation_plans",
        "base_url": "{base_url}/api/v1/applications/oms",
        "auth": { "token": "your_token_here" }
      },
      {
        "endpoint": "countries",
        "base_url": "{base_url}/api/v1/applications/oms",
        "auth": { "token": "your_token_here" }
      },
      {
        "endpoint": "countries_count",
        "base_url": "{base_url}/api/v1/applications/oms",
        "auth": { "token": "your_token_here" }
      },
      {
        "endpoint": "countries_with_code",
        "base_url": "{base_url}/api/v1/applications/oms",
        "auth": { "token": "your_token_here" }
      },
      {
        "endpoint": "cities",
        "base_url": "{base_url}/api/v1/applications/oms",
        "auth": { "token": "your_token_here" }
      },
      {
        "endpoint": "townships",
        "base_url": "{base_url}/api/v1/applications/oms",
        "auth": { "token": "your_token_here" }
      },
      {
        "endpoint": "townships_count",
        "base_url": "{base_url}/api/v1/applications/oms",
        "auth": { "token": "your_token_here" }
      },
      {
        "endpoint": "districts",
        "base_url": "{base_url}/api/v1/applications/oms",
        "auth": { "token": "your_token_here" }
      },
      {
        "endpoint": "districts_count",
        "base_url": "{base_url}/api/v1/applications/oms",
        "auth": { "token": "your_token_here" }
      }
    ]
  }
}
```

{% hint style="danger" %}
Ensure that:

* Authentication credentials are correct,
* `base_url` is updated,
* All relevant endpoints (e.g., `orders`, `orderitem_set`, `cities`, `districts`, etc.) are listed with valid tokens.
  {% endhint %}
  {% endstep %}

{% step %} <mark style="color:red;">**Defining OMS Webhooks for Package Events**</mark>

These webhook definitions can be created either via the UI or through the API. Below are the required webhook types and their corresponding `target_url`s.

* **Package Created:**\
  `{seller_center_base_url}/api/v1/applications/oms/packages/`\
  **Webhook:**
  * `package.created`
* **Package Status Updates:**\
  `{seller_center_base_url}/api/v1/applications/oms/packages/update-status/`\
  **Webhook:**
  * `package.status.preparing`
  * `package.status.packed`
  * `package.status.delivered`
  * `package.status.shipped`
  * `package.status.packed_for_refund`
  * `package.status.out_of_stock`
  * `package.status.ready_for_customer_pickup`
  * `package.status.cancelled`
    {% endstep %}

{% step %} <mark style="color:red;">**Configuring Seller Center Settings for OMS Integration**</mark>

* Request the `supplier_code` from Seller Center for the seller and enter it into the OMS Application Settings.
* Configure **order filtering rules**.
* Define **required status transitions** for order processing.
* Set up **shipping configuration** parameters.
* Register all required **business scenarios** within the system.
  {% endstep %}
  {% endstepper %}

***

## Additional Notes

* On the Seller Center side, a single static channel is sent along with each order.
* This channel is created when the **first order** is received.
* Therefore, if OMS scenarios depend on a specific channel, those configurations must be applied **after the first order has been created**.
