### Overview

In order to update data of purchase order items, you can consume the endpoint presented in this article. In order to consume it, you must:

- Be an authenticated user

For information on how you can authenticate, see: [Authentication](https://developer.sellercloud.com/dev-article/authentication/)

As soon as you do authentication and receive a valid token, it needs to be passed to the service call.

### Endpoint

Example for such endpoint for **TT** server is:

`https://tt.api.sellercloud.com/rest/api/PurchaseOrders/{id}/Items`

For your server endpoint will be:

`https://{your_server_id}.api.sellercloud.com/rest/api/PurchaseOrders/{id}/Items`

### Request

Information about expected request parameters can be found on swagger UI [https://tt/api.sellercloud.com/rest/swagger](https://tt/api.sellercloud.com/rest/swagger).

- Method Type: **HttpPut**
- Authorization: Use **Bearer Token** (where ‘Token’ is the token received from token authentication)
- Header info: **Content-Type: application/json**
- Parameters: ID of existing purchase order
- Request Body:

```
{
  "Items": [
    {
      "ID": 0,
      "QtyUnitsOrdered": 0,
      "UnitPrice": 0,
      "QtyCasesOrdered": 0,
      "QtyUnitsPerCase": 0,
      "CasePrice": 0,
      "ExpectedDeliveryDate": "2021-01-06T12:27:59.154Z"
    }
  ]
}
```

| Parameter                   | Data Type | Description                                                                                                    | Is Required |
|-----------------------------|-----------|----------------------------------------------------------------------------------------------------------------|-------------|
| Items                       | Array     | List of purchase order items to update                                                                        | true        |
| Item.ID                    | integer   | Purchase order item ID                                                                                        | true        |
| Item.QtyUnitsOrdered       | integer   | Quantity of ordered items. Can be provided only for PO in non case quantity mode.                            | false       |
| Item.UnitPrice             | decimal   | Price per item. Can be provided only for PO in non case quantity mode.                                       | false       |
| Item.QtyCasesOrdered       | integer   | Quantity of ordered cases with items. Can be provided only for PO in case quantity mode.                     | false       |
| Item.QtyUnitsPerCase      | integer   | Quantity of items per case. Can be provided only for PO in case quantity mode.                               | false       |
| Item.CasePrice             | decimal   | Price per case. Can be provided only for PO in case quantity mode.                                           | false       |
| Item.ExpectedDeliveryDate   | DateTime  | Item expected delivery date.                                                                                  | false       |

### Response

- If user is authenticated and purchase order items update is successful, then response will be **Status Code 200 => OK**
- If user is not authenticated, then response will be **Status Code 401 => Not Valid Token**
- In case of error, response will be **Status Code 500 => Internal Server Error**
