> For the complete documentation index, see [llms.txt](https://apidocs.akinon.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidocs.akinon.com/omnitron/integration/migration/old-order-item-migration.md).

# Old Order Item Migration

Order item migrations will not be successful without completing user and order migrations beforehand. Migrated order items are stored in the database as a distinct model, separate from the Order Item model in Omnitron. As a result, they won't be displayed on the panel. Users can view their complete past orders on this page `{{shop_url}}/users/old-orders/{{pk}}`.

### Example Request

```
curl --location --request POST 'https://{{omnitron_url}}/api/v1/remote/{{channel_id}}/migrations/start/order_item/' \
--header 'Authorization: Token {{token}}' \
--form 'file=@"/path/to/test_order-item.json"'
```

#### **Test Order Item File Format (test\_order-item.json)**

```json
[
  {
    "order_number": "ORD1234",
    "product": "dolor sit amet",
    "sku": "s1k2u30001",
    "quantity": 1,
    "price": 123.90,
    "image_url": "https://testurl.com/test_picture.jpg",
    "extra_field": {}
  }
]
```

**Description:**

Here are the data format requirements for each field in the context of order item migration:

* **"order\_number"**: Should be in String format, mandatory. Must match the "number" field in order migration.
* **"product"**: Should be in String format. Can be null or an empty string. Limited to 256 characters.
* **"sku"**: Should be in String format. Can be null or an empty string. Limited to 128 characters.
* **"quantity"**: Should be in Integer format, mandatory. Can be null. Value must be at least 1.
* **"price"**: Should be in Float format, maximum of 12 digits, accepting 2 digits after the decimal point. Mandatory.
* **"image\_url"**: Should be in URL format, mandatory. Can be null or an empty string.
* **"extra\_field"**: Should be in Dictionary format. If empty, it should be provided as {}.

### Example Response

When a request is made, the response received will be as follows:

```
{"migration_id": "2740e84efe2e4bea91615f46f567aa3c"}
```

#### **Control**

For verification, the following request is sent:

```

curl --location --request GET 'https://{{omnitron_url}}/api/v1/remote/{{channel_id}}/migrations/{{migration_id}}/progress/' \  
--header 'Authorization: Token {{token}}'

```

If the response received is as follows:

```
{
"total_count": 1,
"error_count": 0,
"processed_count": 1
}
```

It means that the order item has been successfully migrated.


---

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

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://apidocs.akinon.com/omnitron/integration/migration/old-order-item-migration.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

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