# OpenAPIs

1. Bearer token for authentication
2. JSON for business data and response

#### Item create/update

**URI** `/api/items`

**Method** `POST`

**Header** `Authorization: Bearer token.string`

**Header** `Content-Type: application/json`

**Body** raw (json)

```json
{
    "items":
    [
        {
            "code": "6901236341384",
            "name": "Tissue133mmx195mm120P",
            "pack_lines":
            [
                {
                "unit_level": "PCS",
                "unit": "PA",
                "ratio": 1,
                "inner_unit": ""
                },
                {
                "unit_level": "CTN",
                "unit": "CT",
                "ratio": 12,
                "inner_unit": "PA"
                }
            ]
        },
        {
            "code": "6923146003442",
            "name": "Toothbrush",
            "pack_lines":
            [
                {
                "unit_level": "PCS",
                "unit": "PC",
                "ratio": 1,
                "inner_unit": ""
                }
            ]
        }
    ]
}
```

**Response** raw (json)

```json
{
    "message": "items created: 2, updated: 0"
}
```

#### Order create/update

**URI** `/api/orders`

**Method** `POST`

**Header** `Authorization: Bearer token.string`

**Header** `Content-Type: application/json`

**Body** raw (json)

```json
{
    "orders":
    [
        {
            "type": "ReceivingOrder",
            "project": "DAD",
            "ref_number": "apitest107",
            "ref_type": "inb",
            "ship_from": "api from address 01",
            "departrue_date": "20220212",
            "ship_to": "api to address 001",
            "delivery_date": "20220305",
            "order_lines":
            [
                {
                    "line_number": "10",
                    "item_code": "6922266446146",
                    "quantity": 102,
                    "unit": "CT",
                    "lot_attributes":
                    ["PackDate:20200703", "ExpiryDate:20230703"]
                }
            ]
        },
        {
            "type": "ShippingOrder",
            "project": "DAD",
            "ref_number": "apitest106",
            "ref_type": "SalesOrd",
            "ship_from": "api from address 01",
            "departrue_date": "20220212",
            "ship_to": "api to address 001",
            "delivery_date": "20220305",
            "order_lines":
            [
                {
                    "line_number": "10",
                    "item_code": "6922266446146",
                    "quantity": 102,
                    "unit": "CT",
                    "lot_attributes":
                    ["PackDate:20200703", "ExpiryDate:20230703"]
                }
            ]
        }
    ]
}
```

**Response** raw (json)

```json
{
    "message": "orders created: 2, updated: 0"
}
```

#### Ownership Transfer Order create

**URI** `/api/transfers`

**Method** `POST`

**Header** `Authorization: Bearer token.string`

**Header** `Content-Type: application/json`

**Body** raw (json)

```json
{
    "transfer_orders":
    [
        {
            "from_project": "DAD",
            "from_ref_number": "transfer_from_003",
            "from_ref_type": "outbound",
            "to_project": "MOM",
            "to_ref_number": "transfer_to_003",
            "to_ref_type": "inbound",
            "ship_from": "api from address 01",
            "departrue_date": "20220212",
            "ship_to": "api to address 001",
            "delivery_date": "20220305",
            "order_lines":
            [
                {
                    "line_number": "10",
                    "item_code": "6922266446146",
                    "quantity": 102,
                    "unit": "CT",
                    "lot_attributes":
                    ["PackDate:20200703", "ExpiryDate:20230703"]
                }
            ]
        }
    ]
}
```

**Response** raw (json)

```json
{
    "message": "transfer orders created: 2"
}
```


---

# Agent Instructions: 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:

```
GET https://www.litewm.com/litewm-warehouse-management-saas/openapis.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
