# Order Flow

The **Order Flow** facilitates the transfer of order data from Omnitron to ERP systems. The flow retrieves a list of orders that have not yet been sent to the ERP and processes them accordingly. The flow operates only in an inbound mode.

Inbound order flow means that the flow triggers itself at specific intervals set by the user, such as once every minute, every 1 hour, every day at midnight, every 5th day of a month, etc., to fetch unsent orders from Omnitron and send them to the ERP system. If the transfer to the ERP is successful, the order is marked as "is sent" in Omnitron, ensuring clear tracking and synchronization of orders between the systems.

This process ensures reliable and efficient communication between Omnitron and ERP, maintaining accurate and up-to-date order information across the system.

### <mark style="color:red;">Order Flow Type​</mark> <a href="#order-flow-type" id="order-flow-type"></a>

* **Inbound Flow:** Indicates that the flow will read data from the Omnitron. A cron schedule is set up to ensure it runs, for example, every 5 minutes.

### <mark style="color:red;">Flow Steps​</mark> <a href="#flow-steps" id="flow-steps"></a>

* **Login Step:** Handles logging into Omnitron and (if configured) the ERP system. If an error occurs during this step, the details are logged.
* **Read Data From Omnitron Step:** Order queries are made to the Omnitron system to find orders where Omnitron “is\_send” value is false and not canceled matching the channel filter.
* **Query Check Order Step:** For each order, an ERP query is made using order number to see if the order is already written to the ERP, if the execution skips to **Check Response Script Step**.
* **Script Step (Optional):** Transformation operations on each order object is performed using Python, if required.
* **Mapping Step (Optional):** Transformation operations on each order object is performed using the Jolt Transform library. Further details can be found at the [Jolt Transform](https://jolt-demo.appspot.com/#inception) website.
* **Write Data to ERP Step:** The transformed order information is sent to ERP.
* **Check Response Script Step:** The **Write Data to ERP Step** input data and ERP response for each order is given to python script one by one to check if ERP requests are successful and prepare mapping data for **Write Data to Omnitron** step.
* **Write Data to Omnitron Step:** For each order, order is marked as “is send”, order and order item mappings are done based on Check Response Script output.
* **Post Script Step:** Runs after Write Data to Omnitron Step if Check Response Script step is successful or after Write Data To ERP step if it fails and Post Script is configured to run on failure.

### <mark style="color:red;">Detailed Flow Designer Settings​</mark> <a href="#detailed-flow-designer-settings" id="detailed-flow-designer-settings"></a>

#### Configuration Card​ <a href="#configuration-card" id="configuration-card"></a>

<figure><img src="https://3333414532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbwGN7KwvYi0iLbjtnXz%2Fuploads%2FjT1SG545m8fVDhTzd1zs%2Fimage.png?alt=media&#x26;token=2d9627c9-b4a5-40cf-8d26-4bfd9e3555f5" alt=""><figcaption></figcaption></figure>

* **Omnitron API Settings**
  * **Domain URL:** Omnitron's domain URL, Example: <https://demo.omnitron.akinon.net/>.

#### Read Data From Omnitron​ <a href="#read-data-from-omnitron" id="read-data-from-omnitron"></a>

Example data structure for an order object and its related items can be found at the end of this document under the ["Example Order Data Structure from Omnitron"](#example-order-data-structure-from-omnitron) section.

This card requires only the **Omnitron Channel** parameter to be specified for filtering orders based on designated sales channels.

**Omnitron Channel:** The Omnitron Channel parameter is used to filter orders based on specific Omnitron channels. This input requires a comma-separated list of channel IDs. Channel IDs can be found in Omnitron by navigating to *Settings > Sales Channels*. The channel ID is visible in the URL for each channel on the Sales Channels page.

<figure><img src="https://3333414532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbwGN7KwvYi0iLbjtnXz%2Fuploads%2FRPS78kiQelVsHvTPb3yj%2Fimage.png?alt=media&#x26;token=f69e2fb1-2f0c-4284-a7a2-1cd595b8b9c5" alt=""><figcaption></figcaption></figure>

The Omnitron query flow retrieves order data based on the specified channel filter. This process is for informational purposes, as the actual order flow is managed by the system itself. The query operates using the following path:

```
/api/v1/orders_integration/?is_send=false&id__gt=<used_as_pagination>&sort=id&limit=25&status=400&status=450&status=500&status=510&status=540&status=550&modified_date__gt=<last 3 weeks>&channel__in=<channel_filter>
```

This query retrieves orders that have not been sent (`is_send=false`), has one of the statuses 400, 450, 500, 510, 540, 550 and match the specified channel filter. The `modified_date__gt` parameter is used to filter orders modified within the last three weeks, ensuring that only recent orders are processed.

**Steps in the Flow​**

1. **Query Orders**: Orders are retrieved from Omnitron that are neither canceled nor already sent to the ERP.
2. **Retrieve Order Details**: For each order returned by the query, the following steps are performed:
   * An **order detail** request is made using: `/api/v1/orders_integration/<order_pk>/detailed_integration`
   * **Order items** are queried using: `/api/v1/order_items/?order_id=<order_pk>&limit=99999`
   * For each order item, detailed data is retrieved via: `/api/v1/order_items/<order_item_pk>/detailed_integration`
   * **Discount items** are queried similarly via: `/api/v1/discount_items/?order_id=<order_pk>&limit=99999`
   * For each discount item, detailed data is retrieved via: `/api/v1/discount_items/<discount_item_pk>/detailed_integration`
3. **Build Detailed Order Data**: Both the order items and discount items are appended to the detailed order data structure.

#### Query Check Order​ <a href="#query-check-order" id="query-check-order"></a>

Each order is queried on the ERP system to see if it is already sent. If the order is already sent, execution skips to the “Check Response Script” step for the related order with order data from Omnitron and ERP response.

<figure><img src="https://3333414532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbwGN7KwvYi0iLbjtnXz%2Fuploads%2FS97hsQ71Ky7IqWaWqrxb%2Fimage.png?alt=media&#x26;token=f6f6f2f4-67e1-46b8-a7f8-0ade15bd0321" alt=""><figcaption></figcaption></figure>

* **Query URL:** The ERP URL to query order from, order number is provided to this input using `${_order.number}` variable, Integrator will not modify the URL before query a valid query should be provided in the input for querying the order using order number. Ex: [https://example.com/order/query?number=${\_order.number}](https://example.com/order/query?number=$%7B_order.number%7D)
* **Custom Response Path:** This is used to point where order information (if exists) should be when a query response is successful, if the path result is not empty or equal to Custom Response Path Value the query result will be considered to be found.
* **Custom Response Path Value:** Used with **Custom Response Path**, if the path result is equal to the input value, the query is considered to be not found and the execution will continue to next steps as usual.
* **Failure Status Codes:** A list of comma separated HTTP status codes. If an ERP query gets a response with status codes written in this input execution will end with a failure without continuing. This input is useful to find if an ERP can not respond correctly at the moment and it is impossible to know if order already exists or not in the system.
* **Order Not Found Codes:** A list of comma separated HTTP status codes. If an ERP query gets a response with status codes written in this input, flow will continue to the next steps normally. This is useful if an ERP system responds with success codes with a body like 201 even if the order does not exist in the system.

#### Script Card (Optional)​ <a href="#script-card-optional" id="script-card-optional"></a>

This is a base script that can be updated to enable script functionality within the process step.

Scripts can read incoming data from the `inputStream`, where the variable `input_text` contains a JSON string. This string should be parsed using Python's `json` library. Any outgoing data is written using the `outputStream.write()` method after converting the relevant Python object back into a JSON string.

Additionally, the script allows for the use of attributes, which provide supplementary information tied to the current execution process. These attributes can be freely accessed or modified throughout the script. For example, the `get_attribute()` function is used to read attribute values, while the `session.putAttribute()` method is used to write new string attribute values. Each attribute consists of a key-value pair, where the `key` uniquely identifies the attribute, and the `value` can be referenced in subsequent steps. On Order flows, `order_exists` attribute can be set as “true” (string true) to set order as already exists in the script step, this is useful if order can not be queried using the **Query Check Order** step.

Attributes with keys starting with the prefix `log.`will be automatically logged at the end of the execution if a log file is generated, ensuring that important information is captured and available for later review.

<figure><img src="https://3333414532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbwGN7KwvYi0iLbjtnXz%2Fuploads%2F2BCMZ8zvVqcqKjUPe1tB%2Fimage.png?alt=media&#x26;token=f603a94a-fa32-46ee-a381-9d507636d1a4" alt=""><figcaption></figcaption></figure>

**Example Script:**

```python
import json
import traceback
from java.nio.charset import StandardCharsets
from org.apache.commons.io import IOUtils
from org.apache.nifi.processor.io import StreamCallback

def get_attribute(flow_file, attr_name):
   all_var = flow_file.getAttribute("allVar")
   if all_var:
       all_attributes = json.loads(all_var)
       return all_attributes.get(attr_name, None)
   return flow_file.getAttribute(attr_name)

class TransformCallback(StreamCallback):
   def __init__(self, flowFile):
       self.flowFile = flowFile
       self.omnitronToken = get_attribute(flowFile, "token.omnitron")
       self.erpToken = get_attribute(flowFile, "token.erp")

   def process(self, inputStream, outputStream):
       input_text = IOUtils.toString(inputStream, StandardCharsets.UTF_8)
       input_obj = json.loads(input_text)

       # Transform content
       output_obj = self.transform(input_obj)

       # Write output content
       outputStream.write(bytearray(json.dumps(output_obj, indent=4).encode('utf-8')))
      
   def transform(self, output_obj):
       # Transform content
       return output_obj

flowFile = session.get()
if flowFile != None:
   try:
       flowFile = session.write(flowFile, TransformCallback(flowFile))
       # Finish by transferring the FlowFile to an output relationship
       session.transfer(flowFile, REL_SUCCESS)
   except:
       var = traceback.format_exc()
       session.putAttribute(flowFile, 'log.script.error', str(var))
       session.transfer(flowFile, REL_FAILURE)
   session.commit()
```

**Script Testing:** The ERP response is placed in the input field, and the script's result along with the written attributes can be viewed in the result field. When the test script is run, attributes like `log.script.error` will appear under the "attributes" section in the result panel and should be referenced if any exceptions occur during execution. The script's output content will be found under the `result_data` value.

The **+ Add Attributes** button can be used to simulate incoming, readable, attributes for the script. This feature is useful when an attribute value is read and used in the script. Note that attributes added through the button are only for testing purposes and will not be saved in the flow information—they will be removed when the page is refreshed.

**Example Input:** Example input can be constructed using the endpoints written in Read Data From Omnitron or a data **similar** to that can be retrieved from Omnitron using `/api/v1/orders_integration/detailed/?limit=1&number=<order_number>` endpoint. The input of the script step will be **an order object** of the retrieved order array, script step is expected to run with **only** one order each time.

#### Mapping Card (Optional)​ <a href="#mapping-card-optional" id="mapping-card-optional"></a>

<figure><img src="https://3333414532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbwGN7KwvYi0iLbjtnXz%2Fuploads%2F75zIWRD03COr45LBJfq7%2Fimage.png?alt=media&#x26;token=5f890454-f650-45b5-9488-8c575e96dc51" alt=""><figcaption></figcaption></figure>

Details can be found at the [Jolt Transform](https://jolt-demo.appspot.com/#inception) website. The flow expects the following output to be an order request object for each order, as the input will also be the data of one order. Integrator uses the output of this mapping step as the body of the ERP request, therefore there is no expected data structure; the output structure of the mapping step is fully dependent on ERP requirements.

**Mapping Testing:**

The response from the script or the response of the Omnitron request for order data, if the script step is not used, is placed in the input field and the result of the mapping is viewed in the result field.

#### Write Data to ERP​ <a href="#write-data-to-erp" id="write-data-to-erp"></a>

<figure><img src="https://3333414532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbwGN7KwvYi0iLbjtnXz%2Fuploads%2F889r0JtsEu4TnVf2Uwy1%2Fimage.png?alt=media&#x26;token=6d3d7795-9e5b-4549-9f3f-d826454cd013" alt=""><figcaption></figcaption></figure>

The finalized data from Script and/or Mapping steps is sent to ERP using configuration entered in this step. A successful request must respond with 2xx HTTP status codes.

* **ERP Order Create API URL:** ERP URL for writing the orders to.
* **ERP Order Create API Method:** The HTTP method used while creating the order on ERP.

#### Check Response Script​ <a href="#check-response-script" id="check-response-script"></a>

<figure><img src="https://3333414532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbwGN7KwvYi0iLbjtnXz%2Fuploads%2FZy0xLyVmzsoBXmbU4dwF%2Fimage.png?alt=media&#x26;token=275a98ba-b6bf-4ab1-813e-3c4ed650c9f8" alt=""><figcaption></figcaption></figure>

The response from the **Write Data to ERP Step** is merged with the request body and passed to the **Check Response Script Step**. This step is very similar to the Script Card (Optional) which can be used to learn about the details of scripting in Integrator.

Check Response Script comes with a default script where the mapping values are gathered from request data assuming request data has a similar structure to Omnitron data. In the case that request data changed from Omnitron data and can not be used the same way, request and response data should be used to fill out the following structure same way the default script does:

```
{
  "is_send" : "1",
  "data" : {
    "response_data" : "request data here",
    "request_data" : "responnse data here"
  },
  "order_mapping_value" : "<order number according to erp>",
  "external_status" : null,
  "orderitems" : [ {
    "update_stock" : true,
    "external_status" : null,
    "order_item_id" : "<omnitron order item id>",
    "extra_field" : { },
    "item_mapping_code" : "< order item code according to erp>"
  } ],
  "extra_field" : { }
}
```

#### Post Script (Optional)​

<figure><img src="https://3333414532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbwGN7KwvYi0iLbjtnXz%2Fuploads%2FZNSOx276pH0LlELrBDNy%2Fimage.png?alt=media&#x26;token=abb36ba1-c283-4b4f-8c32-8a28116b869c" alt=""><figcaption></figcaption></figure>

This script runs with the “request\_data” and “response\_data” from the ERP write request after the "Write Data to Omnitron" step, if the "Write Data to ERP" step is successful. If the step fails and “Run On Failed Order” is set to true, the script will run directly after the "Write Data to ERP" step.

This script is optional, and its output is not used. It can be used for additional actions after the order is updated in Omnitron, such as updating CRM services or performing other tasks.

### Example Order Data Structure from Omnitron​ <a href="#example-order-data-structure-from-omnitron" id="example-order-data-structure-from-omnitron"></a>

```json
{
  "pk": 9876421,
  "number": "00122340593828",
  "channel": {
    "catalog": 1,
    "category_tree": null,
    "channel_type": "web",
    "created_date": "2020-11-18T13:39:54.915941Z",
    "is_active": true,
    "modified_date": "2020-12-03T10:45:42.549091Z",
    "name": "Shop",
    "pk": 1
  },
  "status": "550",
  "date_placed": "2021-11-03T09:56:55.054375Z",
  "customer": {
    "pk": 28388,
    "channel": 1,
    "email": "akinonuser@akinon.com",
    "first_name": "Akinon",
    "last_name": "Shop",
    "phone_number": null,
    "is_active": true,
    "channel_code": "122222",
    "erp_code": null,
    "extra_field": {},
    "modified_date": "2021-11-03T09:57:10.357301Z",
    "created_date": "2021-11-03T09:57:10.357276Z",
    "date_joined": "2021-11-03T09:56:54.397667Z",
    "email_allowed": false,
    "sms_allowed": false,
    "gender": null,
    "attributes": {
      "register_client_type": "default",
      "logged_ip": "111.111.11.22"
    },
    "user_type": "guest"
  },
  "shipping_address": {
    "pk": 63038,
    "email": "akinonuser@akinon.com",
    "phone_number": "05555552241",
    "first_name": "Akinon",
    "last_name": "Shop",
    "country": {
      "pk": 1,
      "is_active": true,
      "name": "Türkiye",
      "code": "tr",
      "translations": null,
      "mapping": []
    },
    "city": {
      "pk": 40,
      "is_active": true,
      "name": "İSTANBUL",
      "country": 1,
      "translations": null,
      "priority": null,
      "mapping": [
        {
          "pk": 7233,
          "content_type": 56,
          "object_id": 40,
          "integration_type": "ups",
          "code": "34"
        }
      ]
    },
    "line": "Vezir 999 A Bebek",
    "title": "Home",
    "township": {
      "pk": 457,
      "is_active": true,
      "name": "BEŞİKTAŞ",
      "city": 40,
      "mapping": [
        {
          "pk": 7242,
          "content_type": 54,
          "object_id": 457,
          "integration_type": "ups",
          "code": "439"
        }
      ]
    },
    "district": {
      "pk": 35351,
      "is_active": true,
      "name": "BEBEK MAH",
      "city": 40,
      "township": 457,
      "zipcode": "34342",
      "mapping": []
    },
    "postcode": "",
    "notes": null,
    "company_name": "",
    "tax_office": "",
    "tax_no": "",
    "e_bill_taxpayer": false,
    "hash_data": "c782306f6ee57ffcb52570ad6832b352",
    "address_type": "customer",
    "retail_store": null,
    "remote_id": null,
    "identity_number": null,
    "extra_field": {},
    "customer": {
      "pk": 28388,
      "channel": 1,
      "email": "akinonuser@akinon.com",
      "first_name": "Akinon",
      "last_name": "Shop",
      "phone_number": null,
      "is_active": true,
      "channel_code": "111111",
      "erp_code": null,
      "extra_field": {},
      "modified_date": "2021-11-03T09:57:10.357301Z",
      "created_date": "2021-11-03T09:57:10.357276Z",
      "date_joined": "2021-11-03T09:56:54.397667Z",
      "email_allowed": false,
      "sms_allowed": false,
      "gender": null,
      "attributes": {
        "register_client_type": "default",
        "logged_ip": "111.111.11.11"
      },
      "user_type": "guest"
    },
    "is_active": true,
    "mapping": []
  },
  "billing_address": {
    "pk": 11111,
    "email": "akinonuser@akinon.com",
    "phone_number": "05553332211",
    "first_name": "Akinon",
    "last_name": "Shop",
    "country": {
      "pk": 1,
      "is_active": true,
      "name": "Türkiye",
      "code": "tr",
      "translations": null,
      "mapping": []
    },
    "city": {
      "pk": 40,
      "is_active": true,
      "name": "İSTANBUL",
      "country": 1,
      "translations": null,
      "priority": null,
      "mapping": [
        {
          "pk": 7233,
          "content_type": 56,
          "object_id": 40,
          "integration_type": "ups",
          "code": "34"
        }
      ]
    },
    "line": "Vezir 999 A Bebek",
    "title": "Ev",
    "township": {
      "pk": 457,
      "is_active": true,
      "name": "BEŞİKTAŞ",
      "city": 40,
      "mapping": [
        {
          "pk": 7242,
          "content_type": 54,
          "object_id": 457,
          "integration_type": "ups",
          "code": "439"
        }
      ]
    },
    "district": {
      "pk": 35351,
      "is_active": true,
      "name": "BEBEK MAH",
      "city": 40,
      "township": 457,
      "zipcode": "34342",
      "mapping": []
    },
    "postcode": "",
    "notes": null,
    "company_name": "",
    "tax_office": "",
    "tax_no": "",
    "e_bill_taxpayer": false,
    "hash_data": "c782306f6ee57ffcb52570ad6832b352",
    "address_type": "customer",
    "retail_store": null,
    "remote_id": null,
    "identity_number": null,
    "extra_field": {},
    "customer": {
      "pk": 11111,
      "channel": 1,
      "email": "akinonuser@akinon.com",
      "first_name": "Akinon",
      "last_name": "Shop",
      "phone_number": null,
      "is_active": true,
      "channel_code": "138165",
      "erp_code": null,
      "extra_field": {},
      "modified_date": "2021-11-03T09:57:10.357301Z",
      "created_date": "2021-11-03T09:57:10.357276Z",
      "date_joined": "2021-11-03T09:56:54.397667Z",
      "email_allowed": false,
      "sms_allowed": false,
      "gender": null,
      "attributes": {
        "register_client_type": "default",
        "logged_ip": "111.111.11.11"
      },
      "user_type": "guest"
    },
    "is_active": true,
    "mapping": []
  },
  "currency": "try",
  "amount": "540.00",
  "shipping_amount": "0.00",
  "shipping_tax_rate": null,
  "extra_field": {},
  "transaction_set": [
    {
      "pk": 22222,
      "transaction_type": "purchase",
      "transaction_id": "4444444444444444",
      "auth_code": "693261",
      "pos": {
        "pk": 34,
        "name": "Ziraat Bankası",
        "slug": "ZRT",
        "gateway": "omnicore.libs.payment_gateways.nestpay.NestpayGateway",
        "config": {
          "stored_card_pos_id": null,
          "store_key": "11111111111",
          "bank_code": null,
          "section_active": false,
          "allowed_md_statuses": ["1", "3", "2", "4"],
          "section_with_installment": null,
          "bank_ica": null,
          "section_without_installment": null,
          "auth": {
            "username": "*********",
            "password": "**********",
            "client_id": "**********"
          },
          "security_level": "3D",
          "three_d_enabled": true
        },
        "resource_url": "https://sanalpos2.ziraatbank.com.tr/fim/api",
        "three_d_resource_url": "https://sanalpos2.ziraatbank.com.tr/fim/est3Dgate",
        "channel": 1,
        "gateway_display": "Nestpay"
      },
      "main_pos": null,
      "order": {
        "pk": 100071,
        "number": "1807113411111111",
        "channel": 1,
        "status": "400",
        "date_placed": "2021-11-03T09:56:55.054375Z",
        "customer": 28388,
        "shipping_address": 63038,
        "billing_address": 63038,
        "currency": "try",
        "amount": "540.00",
        "shipping_amount": "0.00",
        "shipping_tax_rate": null,
        "extra_field": {},
        "payment_option": 1,
        "payment_option_slug": "credit-cart",
        "bin_number": "540669",
        "installment": 4,
        "installment_count": 1,
        "delivery_type": null,
        "installment_interest_amount": "0.00",
        "cargo_company": 1,
        "invoice_number": null,
        "invoice_date": null,
        "e_archive_url": null,
        "refund_amount": "0.00",
        "discount_refund_amount": "0.00",
        "shipping_refund_amount": "0.00",
        "discount_amount": "0.00",
        "is_send": false,
        "net_shipping_amount": 0.0,
        "shipping_interest_amount": "0.00",
        "tracking_number": null,
        "carrier_shipping_code": null,
        "remote_addr": "217.131.83.77",
        "fundstransfertransaction_set": [],
        "has_gift_box": false,
        "gift_box_note": null,
        "external_status": null,
        "client_type": "default",
        "language_code": "tr-tr",
        "notes": null,
        "delivery_range": null,
        "shipping_option_slug": "yurtici-kargo",
        "segment": null,
        "modified_date": "2021-11-03T09:57:10.869475Z"
      },
      "user_email": "akinonuser@akinon.com",
      "is_succeeded": true,
      "amount": "540.00",
      "remote_addr": "217.131.83.77",
      "created_date": "2021-11-03T09:57:10.620267Z",
      "pos_slug": "ZRT"
    }
  ],
  "payment_option": {
    "pk": 1,
    "name": "Credit Cart",
    "slug": "credit-cart",
    "payment_type": "credit_card",
    "sort_order": 0,
    "is_active": true,
    "config": {},
    "translations": null,
    "channel": 1
  },
  "payment_option_slug": "credit-cart",
  "bin_number": "555555",
  "installment": {
    "pk": 4,
    "card": {
      "pk": 4,
      "name": "Bonus",
      "bank": {
        "pk": 4,
        "name": "Garanti Bankası",
        "slug": "garanti-bankas",
        "logo": "https://example.akinoncdn.com/banks/2021/02/01/555555-aaca-4d0d-864c-a7cad2578e8b.jpg",
        "channel": 1
      },
      "card_type": {
        "pk": 1,
        "name": "Bonus",
        "slug": "bonus",
        "logo": "https://example.akinoncdn.com/card_types/2020/11/26/555555-7c13-44bc-91a3-54c45927bb73.jpg",
        "channel": 1
      },
      "card_payment_type": "credit",
      "cash_payment": 34,
      "installment_payment": 34,
      "slug": "bonus",
      "three_d_payment": 34,
      "is_commerce_card": false,
      "channel": 1
    },
    "installment_count": 1,
    "label": "Peşin",
    "interest_rate": "0.000000",
    "is_active": true,
    "config": {},
    "translations": null
  },
  "installment_count": 1,
  "installment_interest_amount": "0.00",
  "cargo_company": {
    "pk": 1,
    "name": "Yurtiçi Kargo",
    "erp_code": "yurtici-kargo",
    "shipping_company": "yurtici"
  },
  "invoice_number": "12884",
  "invoice_date": "2021-11-05T10:24:00Z",
  "e_archive_url": null,
  "refund_amount": "0.00",
  "discount_refund_amount": "0.00",
  "shipping_refund_amount": "0.00",
  "discount_amount": "0.00",
  "cancellation_info": {},
  "status_display": "approved",
  "tracking_number": null,
  "is_send": false,
  "cancel_status": null,
  "net_shipping_amount": 0.0,
  "remote_addr": "217.131.83.77",
  "language_code": "tr-tr",
  "fundstransfertransaction_set": [
    {
      "pk": 7196,
      "order": 100071,
      "user_email": "akinonuser@kinon.com",
      "remote_addr": "127.0.0.1",
      "amount": "560.00",
      "choosen_bank_account": {
        "pk": 2,
        "bank": 4,
        "slug": "H2",
        "holder_name": "Shop Bank Account",
        "iban": "TR01111122222233333344444",
        "is_active": true,
        "sort_order": 0,
        "description": null,
        "channel": 1
      },
      "date_paid": "2021-11-04T07:47:30.187000Z",
      "paid_bank_account": {
        "pk": 1,
        "bank": 15,
        "slug": "H1",
        "holder_name": "Shop Bank Account",
        "iban": "TR01111122222233333344444",
        "is_active": true,
        "sort_order": 0,
        "description": "Shop Bank Account",
        "channel": 1
      },
      "user_holder_name": "Akinon User",
      "user_iban": "1111",
      "transaction_type": "purchase"
    }
  ],
  "has_gift_box": false,
  "gift_box_note": null,
  "tracking_url": "http://selfservis.yurticikargo.com/reports/SSWDocumentDetail.aspx?DocId=2222222",
  "external_status": null,
  "payondeliverytransaction_set": [
    {
      "pk": 18111,
      "order": 9876421,
      "user_email": "akinonuser@akinon.com",
      "remote_addr": "127.0.0.1",
      "amount": "80.00",
      "payment_type": "cash",
      "handling_fee": "0.00",
      "transaction_type": "purchase"
    }
  ],
  "loyaltytransaction_set": [],
  "bextransaction_set": [],
  "cancellationplan_set": [],
  "cashregistertransaction_set": [
    {
      "amount": "959.00",
      "order": 144246,
      "pk": 6036,
      "raw_request": "{\"username\": \"*******\", \"amount\": \"959.00\", \"password\": \"*******\", \"order_number\": \"1191116995013595\", \"transaction_id\": \"3260013246501362\"}",
      "raw_response": "{\"staff_email\": \"staff@company.com\", \"amount\": \"959.00\", \"result\": \"0\", \"shipping_sku\": null, \"error_message\": \"\", \"order_number\": \"1191116995013595\", \"staff_id\": \"7531\", \"transaction_id\": \"3260013246501362\", \"store_id\": \"6326\"}",
      "remote_addr": null,
      "staff_email": "staff@company.com",
      "staff_id": "7531",
      "staff_remote_id": "7531",
      "store_id": "6326",
      "store_remote_id": "6326",
      "transaction_id": "3260013246501362",
      "transaction_type": "purchase",
      "user_email": "johndoe@gmail.com"
    }
  ],
  "client_type": "default",
  "shipping_interest_amount": "0.00",
  "delivery_type": null,
  "notes": null,
  "delivery_range": null,
  "shipping_option_slug": "yurtici-kargo",
  "segment": null,
  "mapping": [],
  "ordertransaction_set": [
    {
      "pk": 100137,
      "uuid": "8474555a-66da-47c5-b497-9e262e9ed14a",
      "payment_option": {
        "pk": 1,
        "name": "Credit Cart",
        "slug": "credit-cart",
        "payment_type": "credit_card",
        "sort_order": 0,
        "is_active": true,
        "config": {},
        "translations": null,
        "channel": 1
      },
      "amount": "540.00",
      "transaction_type": "purchase",
      "order": 100071,
      "transaction_content_type": "orders.transaction",
      "transaction_object_id": 22222,
      "customer": {
        "pk": 28388,
        "channel": 1,
        "email": "akinonuser@akinon.com",
        "first_name": "Akinon",
        "last_name": "Shop",
        "phone_number": null,
        "is_active": true,
        "channel_code": "138165",
        "erp_code": null,
        "extra_field": {},
        "modified_date": "2021-11-03T09:57:10.357301Z",
        "created_date": "2021-11-03T09:57:10.357276Z",
        "date_joined": "2021-11-03T09:56:54.397667Z",
        "email_allowed": false,
        "sms_allowed": false,
        "gender": null,
        "attributes": {
          "register_client_type": "default",
          "logged_ip": "111.111.11.11"
        },
        "user_type": "guest"
      },
      "related_cancellation_plan": null,
      "modified_date": "2021-11-03T09:57:10.673764Z",
      "mapping": []
    }
  ],
  "ordershippinginfo_set": [
    {
      "pk": 22222,
      "order": 999999,
      "order_number": "2222222222222",
      "shipping_company": "yurtici",
      "send_response": {
        "ns1:createShipmentResponse": {
          "@xmlns:ns1": "http://yurticikargo.com.tr/ShippingOrderDispatcherServices",
          "@xmlns:ns3": "http://yurticikargo.com.tr/WSExceptions/",
          "@xmlns:ns2": "http://yurticikargo.com.tr/ShippingOrderDispatcherServices",
          "ShippingOrderResultVO": {
            "count": "1",
            "shippingOrderDetailVO": {
              "cargoKey": "1807113444913537",
              "invoiceKey": "1807113444913537"
            },
            "outFlag": "0",
            "outResult": "Success",
            "jobId": "6541158"
          }
        }
      },
      "is_send": true,
      "cargo_label": null
    }
  ],
  "orderitem_set": [
    {
      "pk": 240901,
      "order": 100071,
      "product": {
        "pk": 2886,
        "name": "Product Name 1",
        "base_code": "52AS006G18",
        "sku": "325AQ006218",
        "product_type": "4",
        "is_active": true,
        "parent": null,
        "attributes": {
          "int_display_name": "Product Name 1",
          "int_product_type": "Numune"
        },
        "attributes_kwargs": {
          "int_product_type": {
            "value": "Numune",
            "data_type": "dropdown",
            "label": "Numune"
          }
        },
        "extra_attributes": {},
        "group_products": [],
        "productimage_set": [
          {
            "pk": 2093,
            "status": "active",
            "image": "https://example.akinoncdn.com/products/1111/02/02/2886/555555555-0658-4884-9053-e0023aea6e48.jpg",
            "order": 0,
            "created_date": "2021-02-02T17:36:02.866482Z",
            "specialimage_set": [],
            "modified_date": "2021-02-02T17:36:02.866521Z"
          }
        ],
        "attribute_set": 67,
        "custom_attribute_set": null,
        "productization_date": null,
        "listing_code": "Product Name 1-Numune",
        "data_source": null,
        "modified_date": "2021-07-07T13:23:12.130026Z",
        "uuid": "1cee8d92-08e0-4118-a026-0cf25e913378"
      },
      "status": "400",
      "price_currency": "try",
      "price": "0.00",
      "tax_rate": "18.00",
      "extra_field": {
        "price_extra_field": {},
        "stock_extra_field": {}
      },
      "price_list": {
        "pk": 1,
        "name": "default_price_list",
        "code": "default_price_list",
        "is_auto_sync": true,
        "modified_date": "2020-10-14T22:29:36.966200Z",
        "created_date": "2020-10-14T22:29:36.966179Z"
      },
      "stock_list": {
        "pk": 1,
        "name": "default_stock_list",
        "code": "default_stock_list",
        "is_auto_sync": true,
        "modified_date": "2020-10-14T22:29:07.316557Z",
        "created_date": "2020-10-14T22:29:07.316539Z"
      },
      "invoice_number": null,
      "invoice_date": null,
      "e_archive_url": null,
      "cancel_status": null,
      "status_display": "approved",
      "installment_interest_amount": "0.00",
      "net_amount": "0.00",
      "tracking_number": null,
      "shipping_company": null,
      "discount_amount": "0.00",
      "shipment_code": null,
      "benefitapplicant_set": [
        {
          "id": 401027,
          "created_date": "2021-11-03T09:57:10.742023Z",
          "modified_date": "2021-11-03T09:57:10.742044Z",
          "discount_share": "0.00",
          "discount_item": 198826,
          "order_item": 240901
        }
      ],
      "external_status": null,
      "retail_price": null,
      "attributes": {},
      "attributes_kwargs": {},
      "tracking_url": null,
      "image": null,
      "parent": null,
      "data_source": null,
      "estimated_delivery_date": null,
      "mapping": []
    },
    {
      "pk": 240902,
      "order": 100071,
      "product": {
        "pk": 1076,
        "name": "Product Name 2",
        "base_code": "A745HMCDR19",
        "sku": "A123HMCDR99",
        "product_type": "0",
        "is_active": true,
        "parent": null,
        "attributes": {
          "google-catalog": "Cosmetic",
          "int_brand": "Brand Name",
          "int_product_type": "Cosmetic Sets",
          "int_Collection": "Cedrat",
          "display-name": "Product Name 2"
        },
        "attributes_kwargs": {
          "int_Collection": {
            "value": "Cedrat",
            "data_type": "dropdown",
            "label": "Cedrat"
          },
          "int_product_type": {
            "value": "Cosmetic Sets",
            "data_type": "dropdown",
            "label": "Cosmetic Sets"
          }
        },
        "extra_attributes": {},
        "group_products": [],
        "productimage_set": [
          {
            "pk": 811,
            "status": "active",
            "image": "https://example.akinoncdn.com/products/2222/01/03/1076/5555555-e59a-4bb9-a7c1-2ea874bc732d.jpg",
            "order": 1,
            "created_date": "2020-12-29T18:13:54.512254Z",
            "specialimage_set": [],
            "modified_date": "2021-01-19T02:06:19.487358Z"
          }
        ],
        "attribute_set": 1,
        "custom_attribute_set": null,
        "productization_date": "2020-12-01T18:34:52.271246Z",
        "listing_code": "Cosmetic Sets",
        "data_source": null,
        "modified_date": "2021-10-25T23:02:17.724262Z",
        "uuid": "d000a29f-a6bf-4b4e-a9b6-280254ef38ce"
      },
      "status": "400",
      "price_currency": "try",
      "price": "540.00",
      "tax_rate": "18.00",
      "extra_field": {
        "price_extra_field": {},
        "stock_extra_field": {}
      },
      "price_list": {
        "pk": 1,
        "name": "default_price_list",
        "code": "default_price_list",
        "is_auto_sync": true,
        "modified_date": "2020-10-14T22:29:36.966200Z",
        "created_date": "2020-10-14T22:29:36.966179Z"
      },
      "stock_list": {
        "pk": 1,
        "name": "default_stock_list",
        "code": "default_stock_list",
        "is_auto_sync": true,
        "modified_date": "2020-10-14T22:29:07.316557Z",
        "created_date": "2020-10-14T22:29:07.316539Z"
      },
      "invoice_number": null,
      "invoice_date": null,
      "e_archive_url": null,
      "cancel_status": null,
      "status_display": "approved",
      "installment_interest_amount": "0.00",
      "net_amount": "540.00",
      "tracking_number": null,
      "shipping_company": null,
      "discount_amount": "0.00",
      "shipment_code": null,
      "benefitapplicant_set": [
        {
          "id": 401028,
          "created_date": "2021-11-03T09:57:10.793133Z",
          "modified_date": "2021-11-03T09:57:10.793157Z",
          "discount_share": "0.00",
          "discount_item": 198827,
          "order_item": 240902
        },
        {
          "id": 401026,
          "created_date": "2021-11-03T09:57:10.735459Z",
          "modified_date": "2021-11-03T09:57:10.735481Z",
          "discount_share": "0.00",
          "discount_item": 198826,
          "order_item": 240902
        }
      ],
      "external_status": null,
      "retail_price": "540.00",
      "attributes": {},
      "attributes_kwargs": {},
      "tracking_url": null,
      "image": null,
      "parent": null,
      "data_source": null,
      "estimated_delivery_date": null,
      "mapping": []
    }
  ],
  "discountitem_set": [
    {
      "pk": 198827,
      "name": "Free Shipping over 200 TL",
      "amount": "0.00",
      "order": 100071,
      "offer_type": "basket_offer",
      "session_offer_type": null,
      "code": null,
      "benefitapplicant_set": [
        {
          "id": 401028,
          "created_date": "2021-11-03T09:57:10.793133Z",
          "modified_date": "2021-11-03T09:57:10.793157Z",
          "discount_share": "0.00",
          "discount_item": 198827,
          "order_item": 240902
        }
      ],
      "promotion": {
        "id": 5512,
        "created_date": "2021-03-04T13:51:16.662294Z",
        "modified_date": "2021-03-04T13:51:16.662319Z",
        "name": "Free Shipping over 200 TL",
        "slug": "kargo-bedava"
      },
      "conditionapplicant_set": [
        {
          "id": 131803,
          "created_date": "2021-11-03T09:57:10.798847Z",
          "modified_date": "2021-11-03T09:57:10.798870Z",
          "discount_item": 198827,
          "order_item": 240902
        }
      ]
    },
    {
      "pk": 198826,
      "name": "",
      "amount": "0.00",
      "order": 100071,
      "offer_type": "basket_offer",
      "session_offer_type": null,
      "code": null,
      "benefitapplicant_set": [
        {
          "id": 401027,
          "created_date": "2021-11-03T09:57:10.742023Z",
          "modified_date": "2021-11-03T09:57:10.742044Z",
          "discount_share": "0.00",
          "discount_item": 198826,
          "order_item": 240901
        },
        {
          "id": 401026,
          "created_date": "2021-11-03T09:57:10.735459Z",
          "modified_date": "2021-11-03T09:57:10.735481Z",
          "discount_share": "0.00",
          "discount_item": 198826,
          "order_item": 240902
        }
      ],
      "promotion": {
        "id": 5612,
        "created_date": "2021-03-25T10:35:13.973005Z",
        "modified_date": "2021-03-25T10:35:13.973454Z",
        "name": "Numune",
        "slug": "numune"
      },
      "conditionapplicant_set": [
        {
          "id": 131802,
          "created_date": "2021-11-03T09:57:10.754975Z",
          "modified_date": "2021-11-03T09:57:10.754997Z",
          "discount_item": 198826,
          "order_item": 240902
        }
      ]
    }
  ]
}
```

| parameter                     | data type      | example                                                                                  | description                                                                             | additional notes                 |
| ----------------------------- | -------------- | ---------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | -------------------------------- |
| pk                            | integer        | 144246                                                                                   | Omnitron ID of Order                                                                    |                                  |
| number                        | string         | 123123123                                                                                | Order Number                                                                            |                                  |
| channel                       | object         | [Channel Object Data](#channel-object)                                                   | Channel of Order                                                                        |                                  |
| date\_placed                  | string         | 2017-04-12T09:30:27.528002Z                                                              | Date of Order                                                                           | It is sent in ISO-8601 standard. |
| bin\_number                   | string         | 55555                                                                                    | Credit Cart Bin Number                                                                  |                                  |
| customer                      | object         | [Customer Object Data](#customer-object)                                                 | Customer Information                                                                    |                                  |
| shipping\_address             | object         | [Address Object Data](#address-object)                                                   | Shipping Address                                                                        |                                  |
| billing\_address              | object         | [Address Object Data](#address-object)                                                   | Billing Address                                                                         |                                  |
| currency                      | string         | eur                                                                                      | Currency                                                                                | enum                             |
| amount                        | string         | 134.37                                                                                   | Amount withdrawn from the bank (VAT included)                                           |                                  |
| shipping\_amount              | string         | 6.99                                                                                     | Shipping amount (VAT included)                                                          |                                  |
| payment\_option\_slug         | string         | credit-cart                                                                              | Payment Option Slug                                                                     |                                  |
| payment\_option               | object         | {}(13)                                                                                   | Payment Option Information                                                              |                                  |
| orderitem\_set                | array\[object] | An array of [order item object data](#order-item-object)                                 | Products of Order                                                                       |                                  |
| discountitem\_set             | array\[object] | An array of [discount item object data](#discount-item-object)                           | Order applied discounts and distributed to the line version of the detail information   |                                  |
| installment                   | object         | installment objects                                                                      | Installment Information containing installment count, interest, name of the option etc. |                                  |
| invoice\_number               | string         | F99827134211                                                                             | Invoice Number                                                                          |                                  |
| invoice\_date                 | string         | 2017-04-12T09:30:27.528002Z                                                              | Invoice Date                                                                            | It is sent in ISO-8601 standard. |
| e\_archive\_url               | string         |                                                                                          | Invoice Archive Url                                                                     |                                  |
| installment\_count            | integer        | 1                                                                                        |                                                                                         |                                  |
| installment\_interest\_amount | string         | 0.00                                                                                     |                                                                                         |                                  |
| cargo\_company                | object         | {}                                                                                       | Cargo Company                                                                           | enum                             |
| discount\_amount              | string         | 9.95                                                                                     | Total Discount Applied of Order                                                         |                                  |
| net\_shipping\_amount         | string         | 10.95                                                                                    | Delay Interest Amount Applied on Cargo Amount                                           |                                  |
| payondeliverytransaction\_set | array\[object] | An array of [pay on delivery transaction object data](#pay-on-delivery-object)           | Detail Information of Pay on Delivery (cash, credit card)                               |                                  |
| has\_gift\_box                | boolean        | true                                                                                     | Is It Gift Boxed?                                                                       |                                  |
| gift\_box\_note               | string         | happy birthday                                                                           | Gift Box Note (cannot be filled if giftbox not selected)                                |                                  |
| loyaltytransaction\_set       | array\[object] | \[]                                                                                      |                                                                                         |                                  |
| transaction\_set              | object         | {}(6)                                                                                    | Payment Detail                                                                          |                                  |
| client\_type                  | string         | default                                                                                  | Platform type                                                                           | enum                             |
| cashregistertransaction\_set  | array\[object] | An array of [cash register transaction object data](#cash-register-transaction-object)   |                                                                                         |                                  |
| ordertransaction\_set         | array\[object] | An array of [order transaction object data](#order-transaction-object)                   |                                                                                         |                                  |
| status                        | string         | 400                                                                                      | Order Status Code                                                                       | enum                             |
| remote\_addr                  | string         | 111.11.111.111                                                                           | User IP Address                                                                         |                                  |
| ordershippinginfo\_set        | array\[object] | An array of [order shipping info object data](#order-shipping-info-object)               | Order Shipping Info                                                                     |                                  |
| shipping\_tax\_rate           | string         | 3                                                                                        | Shipping Tax Rate                                                                       |                                  |
| refund\_amout                 | string         | 0.00                                                                                     | Refund Amount                                                                           |                                  |
| discount\_refund\_amout       | string         | 0.00                                                                                     | Discount Refund Amount                                                                  |                                  |
| shipping\_refund\_amout       | string         | 0.00                                                                                     | Shipping Refund Amount                                                                  |                                  |
| status\_display               | string         | approved                                                                                 | Order Status                                                                            |                                  |
| tracking\_number              | string         | 0726134HBA                                                                               | Tracking Number                                                                         |                                  |
| tracking\_url                 | string         | <http://selfservis.yurticikargo.com/reports/SSWDocumentDetail.aspx?DocId=2222222>        | Tracking Url                                                                            |                                  |
| is\_send                      | boolean        | false                                                                                    | Entegrator Sending State                                                                |                                  |
| cancel\_status                | boolean        |                                                                                          | Cancel Status                                                                           |                                  |
| languge\_code                 | string         | tr-tr                                                                                    | Lang Code                                                                               |                                  |
| fundstransfertransaction\_set | array\[object] | An array of [funds transfer transaction object data](#funds-transfer-transaction-object) | Funds Transfer Transaction Informations                                                 |                                  |
| external\_status              | boolean        |                                                                                          |                                                                                         |                                  |
| delivery\_type                | string         |                                                                                          | Delivery Type                                                                           |                                  |
| notes                         | string         |                                                                                          | Notes                                                                                   |                                  |
| delivery\_range               | string         |                                                                                          | Delivery Range                                                                          |                                  |
| shipping\_option\_slug        | string         | yurtici-kargo                                                                            | Shipping Option Slug                                                                    |                                  |
| segment                       | string         |                                                                                          | Segment                                                                                 |                                  |
| shipping\_interest\_amount    | string         | 0.00                                                                                     | Shipping Interest Amount                                                                |                                  |

**Channel Object**

```json
{
  "catalog": 1,
  "category_tree": 2,
  "channel_type": "web",
  "created_date": "2020-11-18T13:39:54.915941Z",
  "is_active": true,
  "modified_date": "2020-12-03T10:45:42.549091Z",
  "name": "Shop",
  "pk": 1
}
```

| parameter      | data type | example                     | description            | additional notes          |
| -------------- | --------- | --------------------------- | ---------------------- | ------------------------- |
| catalog        | integer   | 1                           | Catalog                |                           |
| category\_tree | object    | 2                           |                        |                           |
| channel\_type  | string    | web                         | Channel Type           | enum                      |
| created\_date  | string    | 2020-11-18T13:39:54.915941Z |                        | sent on ISO-8601 standard |
| pk             | integer   | 323664                      |                        |                           |
| is\_active     | boolean   | true                        | Channel Active/Passive |                           |
| modified\_date | string    | 2020-11-18T13:39:54.915941Z |                        | sent on ISO-8601 standard |
| name           | string    | Shop                        | Channel Name           |                           |

#### Customer Object

```json
{
  "pk": 28388,
  "channel": 1,
  "email": "akinonuser@akinon.com",
  "first_name": "Akinon",
  "last_name": "Shop",
  "phone_number": null,
  "is_active": true,
  "channel_code": "122222",
  "erp_code": null,
  "extra_field": {},
  "modified_date": "2021-11-03T09:57:10.357301Z",
  "created_date": "2021-11-03T09:57:10.357276Z",
  "date_joined": "2021-11-03T09:56:54.397667Z",
  "email_allowed": false,
  "sms_allowed": false,
  "gender": null,
  "attributes": {
    "register_client_type": "default",
    "logged_ip": "111.111.11.22"
  },
  "user_type": "guest"
}
```

| parameter      | data type   | example                     | description                                  | additional notes                                |
| -------------- | ----------- | --------------------------- | -------------------------------------------- | ----------------------------------------------- |
| pk             | integer     | 56839                       | Customer unique ID                           |                                                 |
| attributes     | object/dict | {}                          | Customer properties additional data          |                                                 |
| channel        | integer     | 1                           | Channel ID of customer created               |                                                 |
| channel\_code  | string      | 53241                       | Channel code of customer created             |                                                 |
| created\_date  | string      | 2019-02-12T18:39:09.821551Z | Data create date                             | sent on ISO-8601 standard                       |
| date\_joined   | string      | 2019-02-12T08:04:25.866981Z | Customer create date                         | sent on ISO-8601 standard                       |
| email          | string      | <johndoe@gmail.com>         | Customer unique e-mail                       |                                                 |
| email\_allowed | boolean     | true                        | Permission of customer to send e-mail        |                                                 |
| erp\_code      | string      | 1234                        | Customer ERP code                            | code response after notification of ERP/WMS/SCM |
| extra\_field   | object/dict | {}                          | Additional data about customer               | should be in key/value pair                     |
| first\_name    | string      | John                        | Customer name                                |                                                 |
| gender         | string      | male                        | Customer gender                              | enum                                            |
| is\_active     | boolean     | true                        | Specifies if customer is active / inactive   |                                                 |
| last\_name     | string      | Doe                         | Customer surname                             |                                                 |
| modified\_date | string      | 2019-07-09T16:30:05.281334Z | Data's last update information               | sent on ISO-8601 standard                       |
| phone\_number  | string      | 5320000000                  | Phone number of customer                     | format depends on company                       |
| sms\_allowed   | boolean     | true                        | Permission of customer to send phone message |                                                 |
| user\_type     | string      | registered                  | Information if customer registered           | guest = 'guest'registered = 'registered'        |

#### Address Object

```json
{
  "pk": 63038,
  "email": "akinonuser@akinon.com",
  "phone_number": "05555552241",
  "first_name": "Akinon",
  "last_name": "Shop",
  "country": {
    "pk": 1,
    "is_active": true,
    "name": "Türkiye",
    "code": "tr",
    "translations": null,
    "mapping": [
  ]
}
```

| parameter         | data type      | example                                 | description                                                                          | additional notes                         |
| ----------------- | -------------- | --------------------------------------- | ------------------------------------------------------------------------------------ | ---------------------------------------- |
| pk                | integer        | 1                                       | Address ID                                                                           |                                          |
| title             | string         | Home Address                            | Title of Address                                                                     |                                          |
| address\_type     | string         | customer                                | Address Type                                                                         |                                          |
| is\_active        | boolean        | true                                    | Address Status                                                                       |                                          |
| email             | string         | <user@website.com>                      | E-Mail of Address                                                                    |                                          |
| first\_name       | string         | John                                    | Customer Name of Related Address                                                     |                                          |
| last\_name        | string         | Doe                                     | Customer Surname of Related Address                                                  |                                          |
| phone\_number     | string         | 05320000000                             | Customer Phone Number of Related Address                                             |                                          |
| company\_name     | string         | null                                    | Company Name of Related Address (if filled)                                          |                                          |
| country           | object         | {}                                      | Country Information                                                                  |                                          |
| city              | object         | {}                                      | City Information                                                                     |                                          |
| township          | object         | {}                                      | Township Information                                                                 |                                          |
| district          | object         | {}                                      | District Information                                                                 |                                          |
| line              | string         | xxxxx street, yyyyy shopping mall, no:1 | Full Address Information                                                             |                                          |
| postcode          | string         | 00000                                   | Postcode Information                                                                 |                                          |
| e\_bill\_taxpayer | boolean        | false                                   | Depending on Corporate/Personal Information, it should be true or false              |                                          |
| tax\_office       | string         | {}                                      | Must Be Filled If Corporate                                                          | Must be empty if the address is personal |
| tax\_no           | string         | 000000000000                            | Must Be Filled If Corporate                                                          | Must be empty if the address is personal |
| mapping           | array\[object] | \[]                                     | Mapping Information                                                                  |                                          |
| notes             | string         | null                                    | Notes Belogns to Address                                                             |                                          |
| retail\_store     | object         | {}                                      | Retail Store Data Information must be sent when the shipment type is "Click\&Collect |                                          |
| hash\_data        | string         | c782306f6ee57ffcb5270ad6832b352         | Hashed Data                                                                          |                                          |

#### Order Item Object

```json
{
  "price_with_interest": "59.99",
  "without_vat_calculate_amount": "55.55",
  "extra_field": {},
  "stock_list": "shop_stock_list",
  "price_currency": "euro",
  "calculated_amount": "59.99",
  "benefitapplicant_set": [
    {
      "modified_date": "2019-07-09T16:30:06.266196Z",
      "discount_share": "0.00",
      "promotion_slug": "250-euro-and-next-sale-free-shipping",
      "discount_item": 167125,
      "created_date": "2019-07-09T16:30:06.266153Z",
      "order_item": 372615,
      "id": 496385
    }
  ],
  "pk": 372615,
  "price": "59.99",
  "without_vat_discount_amount": "0.00",
  "status": "400",
  "product": "5645194317",
  "external_status": null,
  "installment_interest_amount": "0.00",
  "price_list": "shop_price_list",
  "tax_rate": "8.00",
  "retail_price": "79.95",
  "discount_amount": "0.00",
  "tax_amount": "4.44",
  "name": "Ürün adı",
  "shipment_code": null,
  "product_image": "https://cdn.akinon.net/products/2019/05/02/247630/ba7820b5-c626-4ed9-a087-6c3a515c03eb.jpg",
  "without_net_amount": "55.55",
  "net_amount": "59.99",
  "order": 144246
}
```

| parameter                     | data type      | example                                                                           | description                                                                  | additional notes                                           |
| ----------------------------- | -------------- | --------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------- |
| pk                            | integer        | 372615                                                                            | Omnitron order item id                                                       |                                                            |
| product                       | object         | {}                                                                                | Product Information                                                          |                                                            |
| order                         | integer        | 144246                                                                            | ID of Related Order                                                          |                                                            |
| status                        | string         | 400                                                                               | Item Status of Order                                                         |                                                            |
| price\_list                   | object         | shop\_price\_list                                                                 | Omnitron Price List Information                                              |                                                            |
| stock\_list                   | object         | shop\_stock\_list                                                                 | Omnitron Stock List Information                                              |                                                            |
| price                         | string         | 59.99                                                                             | Delay Interest and Additional Discount Excluded Selling Price (VAT Included) |                                                            |
| retail\_price                 | string         | 79.95                                                                             |                                                                              |                                                            |
| price\_currency               | string         | eur                                                                               |                                                                              |                                                            |
| discount\_amount              | string         | 199.95                                                                            | Item Discount Amount (VAT Included)                                          |                                                            |
| installment\_interest\_amount | string         | 0.00                                                                              |                                                                              |                                                            |
| tax\_rate                     | string         | 8.00                                                                              | VAT Percentage                                                               |                                                            |
| benefitapplicant\_set         | array\[object] | An array of [benefit applicant objects](#benefit-applicant-object)                | Campaign Information of Discounted Item                                      |                                                            |
| extra\_field                  | object         | {}                                                                                | Extra data of orderitem can place as Key-Value in here                       |                                                            |
| external\_status              | string         | null                                                                              |                                                                              |                                                            |
| invoice\_number               | string         | string                                                                            | Invoice Number                                                               |                                                            |
| invoice\_date                 | string         | 2017-04-12T09:30:27.528002Z                                                       | Invoice Date                                                                 | It is sent in ISO-8601 standard.                           |
| e\_archive\_url               | string         |                                                                                   |                                                                              |                                                            |
| cancel\_status                | string         |                                                                                   |                                                                              |                                                            |
| status\_display               | string         | delivered                                                                         | Order Item Status Label                                                      |                                                            |
| net\_amount                   | string         | 0.00                                                                              |                                                                              |                                                            |
| tracking\_number              | string         | 1233211155232                                                                     | Tracking Number                                                              |                                                            |
| shipping\_company             | string         | yurtici                                                                           | Shipping Company                                                             |                                                            |
| shipment\_code                | string         |                                                                                   |                                                                              |                                                            |
| tracking\_url                 | string         | <http://selfservis.yurticikargo.com/reports/SSWDocumentDetail.aspx?DocId=2222222> | Tracking Url                                                                 |                                                            |
| supplier\_code                | string         | AF1342A                                                                           | Supplier Code                                                                | It will only come to companies that sell unified products. |

#### Discount Item Object

```json
{
  "code": null,
  "name": "Free shipping for purchases of 250 Euro or more",
  "amount": "0.00",
  "benefitapplicant_set": [
    {
      "modified_date": "2019-07-09T16:30:06.297927Z",
      "discount_share": "0.00",
      "discount_item": 167125,
      "created_date": "2019-07-09T16:30:06.297881Z",
      "order_item": 372613,
      "id": 496386
    },
    {
      "modified_date": "2019-07-09T16:30:06.266196Z",
      "discount_share": "0.00",
      "discount_item": 167125,
      "created_date": "2019-07-09T16:30:06.266153Z",
      "order_item": 372615,
      "id": 496385
    },
    {
      "modified_date": "2019-07-09T16:30:06.238280Z",
      "discount_share": "0.00",
      "discount_item": 167125,
      "created_date": "2019-07-09T16:30:06.238250Z",
      "order_item": 372612,
      "id": 496384
    },
    {
      "modified_date": "2019-07-09T16:30:06.207414Z",
      "discount_share": "0.00",
      "discount_item": 167125,
      "created_date": "2019-07-09T16:30:06.207372Z",
      "order_item": 372614,
      "id": 496383
    }
  ],
  "pk": 167125,
  "promotion": {
    "modified_date": "2018-09-14T07:04:06.080758Z",
    "created_date": "2018-09-14T07:04:06.080730Z",
    "slug": "250-euro-and-on-shopping-free-shipping",
    "name": "Free shipping for purchases of 250 Euro or more",
    "id": 419
  },
  "order": 144246
}
```

\| parameter | data type | example | explanation | additional notes | | -------------------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------- | ---------------- | --- | | pk | integer | 167125 | Discount ID |   | | code | string | null | Discount Code |   | | name | string | Free shipping for purchases of 250 Euro or more | Discount Name/Description |   | | amount | decimal | 0.00 | Discount Amount |   | | benefitapplicant\_set | array\[object] | An array of [benefit applicant objects](#benefit-applicant-object) | Campaigns benefited  | | | promotion | object | {"modified\_date": "2018-09-14T07:04:06.080758Z", "created\_date": "2018-09-14T07:04:06.080730Z", "slug": "250-euro-and-on-shopping-free-shipping","name": "Free shipping for purchases of 250 Euro or more", "id": 419} |   |   | | order | integer | 144246 | Order ID |   | | offer\_type | string | basket\_offer | | Offer |   |

#### Benefit Applicant Object

```json
{
  "id": 401028,
  "created_date": "2021-11-03T09:57:10.793133Z",
  "modified_date": "2021-11-03T09:57:10.793157Z",
  "discount_share": "0.00",
  "discount_item": 198827,
  "order_item": 240902
}
```

| parameter       | data type | example                     | description                           | additional notes          |
| --------------- | --------- | --------------------------- | ------------------------------------- | ------------------------- |
| id              | integer   | 496385                      |                                       |                           |
| order\_item     | integer   | 372615                      | pk value of item in orderitem\_set    |                           |
| created\_date   | string    | 2019-07-09T16:30:06.266153Z |                                       | sent on ISO-8601 standard |
| modified\_date  | string    | 2019-07-09T16:30:06.266196Z |                                       | sent on ISO-8601 standard |
| discount\_share | string    | 0.00                        |                                       |                           |
| discount\_item  | integer   | 167125                      | pk value of item in discountitem\_set |                           |

#### Pay On Delivery Object

```json
{
  "pk": 18111,
  "order": 9876421,
  "user_email": "akinonuser@akinon.com",
  "remote_addr": "127.0.0.1",
  "amount": "80.00",
  "payment_type": "cash",
  "handling_fee": "0.00",
  "transaction_type": "purchase"
}
```

| parameter         | data type | example             | description | additional notes |
| ----------------- | --------- | ------------------- | ----------- | ---------------- |
| amount            | string    | 2736.00             |             |                  |
| handling\_fee     | string    | 0.00                |             |                  |
| order             | integer   | 9876421             |             |                  |
| payment\_type     | string    | cash                |             |                  |
| pk                | integer   | 3304                |             |                  |
| remote\_addr      | string    | 0.0.0.0             |             |                  |
| transaction\_type | string    | purchase            |             |                  |
| user\_email       | string    | <johndoe@gmail.com> |             |                  |

#### Cash Register Transaction Object

```json
{
  "amount": "959.00",
  "order": 144246,
  "pk": 6036,
  "raw_request": "{\"username\": \"*******\", \"amount\": \"959.00\", \"password\": \"*******\", \"order_number\": \"1191116995013595\", \"transaction_id\": \"3260013246501362\"}",
  "raw_response": "{\"staff_email\": \"staff@company.com\", \"amount\": \"959.00\", \"result\": \"0\", \"shipping_sku\": null, \"error_message\": \"\", \"order_number\": \"1191116995013595\", \"staff_id\": \"7531\", \"transaction_id\": \"3260013246501362\", \"store_id\": \"6326\"}",
  "remote_addr": null,
  "staff_email": "staff@company.com",
  "staff_id": "7531",
  "staff_remote_id": "7531",
  "store_id": "6326",
  "store_remote_id": "6326",
  "transaction_id": "3260013246501362",
  "transaction_type": "purchase",
  "user_email": "johndoe@gmail.com"
}
```

| parameter         | data type      | example                                                                                                                                                                                                                                       | description | additional notes |
| ----------------- | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | ---------------- |
| amount            | string/decimal | 959.00                                                                                                                                                                                                                                        |             |                  |
| order             | integer        | 144246                                                                                                                                                                                                                                        |             |                  |
| pk                | integer        | 6036                                                                                                                                                                                                                                          |             |                  |
| raw\_request      | string/json    | {"username": "**\*\***", "amount": "959.00", "password": "**\*\*\***", "order\_number": "1191116995013595", "transaction\_id": "3260013246501362"}                                                                                            |             |                  |
| raw\_response     | string/json    | {"staff\_email": "<staff@company.com>", "amount": "959.00", "result": "0", "shipping\_sku": null, "error\_message": "", "order\_number": "1191116995013595", "staff\_id": "7531", "transaction\_id": "3260013246501362", "store\_id": "6326"} |             |                  |
| remote\_addr      | string         | null                                                                                                                                                                                                                                          |             |                  |
| staff\_email      | string         | <staff@company.com>                                                                                                                                                                                                                           |             |                  |
| staff\_id         | string         | 7531                                                                                                                                                                                                                                          |             |                  |
| staff\_remote\_id | string         | 7531                                                                                                                                                                                                                                          |             |                  |
| store\_id         | string         | 6326                                                                                                                                                                                                                                          |             |                  |
| store\_remote\_id | string         | 6326                                                                                                                                                                                                                                          |             |                  |
| transaction\_id   | string         | 3260013246501362                                                                                                                                                                                                                              |             |                  |
| transaction\_type | string         | purchase                                                                                                                                                                                                                                      |             | enum             |
| user\_email       | string         | <johndoe@gmail.com>                                                                                                                                                                                                                           |             |                  |

### Order Transaction Object

```json
{
  "pk": 100137,
  "uuid": "8474555a-66da-47c5-b497-9e262e9ed14a",
  "payment_option": {
    "pk": 1,
    "name": "Credit Cart",
    "slug": "credit-cart",
    "payment_type": "credit_card",
    "sort_order": 0,
    "is_active": true,
    "config": {},
    "translations": null,
    "channel": 1
  },
  "amount": "540.00",
  "transaction_type": "purchase",
  "order": 100071,
  "transaction_content_type": "orders.transaction",
  "transaction_object_id": 22222,
  "customer": {
    "pk": 28388,
    "channel": 1,
    "email": "akinonuser@akinon.com",
    "first_name": "Akinon",
    "last_name": "Shop",
    "phone_number": null,
    "is_active": true,
    "channel_code": "138165",
    "erp_code": null,
    "extra_field": {},
    "modified_date": "2021-11-03T09:57:10.357301Z",
    "created_date": "2021-11-03T09:57:10.357276Z",
    "date_joined": "2021-11-03T09:56:54.397667Z",
    "email_allowed": false,
    "sms_allowed": false,
    "gender": null,
    "attributes": {
      "register_client_type": "default",
      "logged_ip": "111.111.11.11"
    },
    "user_type": "guest"
  },
  "related_cancellation_plan": null,
  "modified_date": "2021-11-03T09:57:10.673764Z",
  "mapping": []
}
```

| parameter                   | data type      | example                                                                                                                                                                                    | description | additional notes          |
| --------------------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------- | ------------------------- |
| amount                      | string/decimal |                                                                                                                                                                                            |             |                           |
| customer                    | object         | [Customer Object Data](#customer-object)                                                                                                                                                   |             |                           |
| order                       | integer        | 144246                                                                                                                                                                                     |             |                           |
| payment\_option             | object         | {  "channel": 1,  "config": {},  "is\_active": true,  "name": "Credit card",  "payment\_type": "credit\_card",  "pk": 1,  "slug": "credit-card",  "sort\_order": 0,  "translations": null} |             |                           |
| pk                          | integer        | 323664                                                                                                                                                                                     |             |                           |
| related\_cancellation\_plan | object         | null                                                                                                                                                                                       |             |                           |
| transaction\_object\_id     | integer        | 366900                                                                                                                                                                                     |             |                           |
| transaction\_type           | string         | purchase                                                                                                                                                                                   |             |                           |
| transaction\_content\_type  | string         | orders.transaction                                                                                                                                                                         |             |                           |
| uuid                        | string         | a1913737-97c8-4c29-919c-a4a9d8ad2cf3                                                                                                                                                       |             |                           |
| modified\_date              | string         | 2019-07-09T16:30:05.281334Z                                                                                                                                                                |             | sent on ISO-8601 standard |

#### Order Shipping Info Object

```json
{
  "pk": 22222,
  "order": 999999,
  "order_number": "2222222222222",
  "shipping_company": "yurtici",
  "send_response": {
    "ns1:createShipmentResponse": {
      "@xmlns:ns1": "http://yurticikargo.com.tr/ShippingOrderDispatcherServices",
      "@xmlns:ns3": "http://yurticikargo.com.tr/WSExceptions/",
      "@xmlns:ns2": "http://yurticikargo.com.tr/ShippingOrderDispatcherServices",
      "ShippingOrderResultVO": {
        "count": "1",
        "shippingOrderDetailVO": {
          "cargoKey": "1807113444913537",
          "invoiceKey": "1807113444913537"
        },
        "outFlag": "0",
        "outResult": "Success",
        "jobId": "6541158"
      }
    }
  },
  "is_send": true,
  "cargo_label": null
}
```

| parameter         | data type | example                                                                                                                                                                                                                                                                                                                                                                                                                    | description           | additional notes |
| ----------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | ---------------- |
| pk                | integer   | 123123                                                                                                                                                                                                                                                                                                                                                                                                                     | ID                    |                  |
| order             | integer   | 100001                                                                                                                                                                                                                                                                                                                                                                                                                     | Related Order ID      |                  |
| order\_number     | string    | 22222222222                                                                                                                                                                                                                                                                                                                                                                                                                | Order Number          |                  |
| shipping\_company | string    | yurtici                                                                                                                                                                                                                                                                                                                                                                                                                    | Shipping Company      |                  |
| is\_send          | boolean   | true                                                                                                                                                                                                                                                                                                                                                                                                                       | Shipping Send Status  |                  |
| send\_response    | object    | "send\_response": {"ns1:createShipmentResponse": {"@xmlns:ns1": "<http://yurticikargo.com.tr/ShippingOrder","@xmlns:ns3>": "<http://yurticikargo.com.tr/WSE/","@xmlns:ns2>": "<http://yurticikargo.com.tr/ShippingOrderDispatcher","ShippingOrderResultVO>": {"count": "1","shippingOrderDetailVO": {"cargoKey": "1807112222222","invoiceKey": "180711222222"},"outFlag": "0","outResult": "Success","jobId": "6541158"}}} | Shipping API Response |                  |
| cargo\_label      | string    |                                                                                                                                                                                                                                                                                                                                                                                                                            |                       |                  |

#### Funds Transfer Transaction Object

```json
{
  "pk": 7196,
  "order": 100071,
  "user_email": "akinonuser@kinon.com",
  "remote_addr": "127.0.0.1",
  "amount": "560.00",
  "choosen_bank_account": {
    "pk": 2,
    "bank": 4,
    "slug": "H2",
    "holder_name": "Shop Bank Account",
    "iban": "TR01111122222233333344444",
    "is_active": true,
    "sort_order": 0,
    "description": null,
    "channel": 1
  },
  "date_paid": "2021-11-04T07:47:30.187000Z",
  "paid_bank_account": {
    "pk": 1,
    "bank": 15,
    "slug": "H1",
    "holder_name": "Shop Bank Account",
    "iban": "TR01111122222233333344444",
    "is_active": true,
    "sort_order": 0,
    "description": "Shop Bank Account",
    "channel": 1
  },
  "user_holder_name": "Akinon User",
  "user_iban": "1111",
  "transaction_type": "purchase"
}
```

| parameter              | data type | example                                                                                                                                                                                                              | description                      | additional notes          |
| ---------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | ------------------------- |
| pk                     | integer   | 123123                                                                                                                                                                                                               | ID                               |                           |
| order                  | integer   | 100001                                                                                                                                                                                                               | Related Order ID                 |                           |
| user\_email            | string    | 1                                                                                                                                                                                                                    | User Email Address               |                           |
| remote\_addr           | string    | 127.0.0.1                                                                                                                                                                                                            | User IP Address                  |                           |
| amount                 | string    | 560.00                                                                                                                                                                                                               |                                  |                           |
| choosen\_bank\_account | object    | "choosen\_bank\_account": {"pk": 2,"bank": 4,"slug": "H2","holder\_name": "Shop Bank Account","iban": "TR01111122222233333344444","is\_active": true,"sort\_order": 0,"description": null,"channel": 1}              | Choosen Bank Account Information |                           |
| paid\_bank\_account    | object    | "paid\_bank\_account": {"pk": 1,"bank": 15,"slug": "H1","holder\_name": "Shop Bank Account","iban": "TR01111122222233333344444","is\_active": true,"sort\_order": 0,"description": "Shop Bank Account","channel": 1} | Paid Bank Account Information    |                           |
| date\_paid             | string    | 2020-11-18T13:39:54.915941Z                                                                                                                                                                                          | Installement Config              | sent on ISO-8601 standard |
| user\_holder\_name     | string    | John Due                                                                                                                                                                                                             |                                  |                           |
| user\_iban             | string    | TR01111234123124222                                                                                                                                                                                                  | User Bank Account Number         |                           |
| transaction\_type      | string    | purchase                                                                                                                                                                                                             | Transaction Type                 |                           |
