> 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

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

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

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