### Overview

This endpoint can be used to split a purchase order.

In order to consume the endpoint you must:

- Be 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 call.

### Endpoint

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

### Request

Method Type: HttpPost

Authorization: Use Bearer Token + token received from token authentication

Header info: Content-Type: application/json

### Request Body

|     |     |     |     |
| --- | --- | --- | --- |
| **Parameter** | **Data Type** | **Description** | Required |
| PoItemsToSplit | List<PoItem> | List of PO items to split | Yes |
| PoItem.ID | Integer | The ID of the PO item to split | Yes |
| PoItem.QtyToSplit | Integer | Quantity to split for this PO item.<br>The field is required when the PO is not in case qty mode.<br>Should not be provided when the PO is in case qty mode. | No |
| PoItem.QtyReceivedToSplit | Integer | Qty received to split for this PO item.<br>Should not be provided when the PO is in case qty mode.<br>It cannot be set when the receiving warehouse for the item is bin-enabled. | No |
| PoItem.CaseQtyToSplit | Integer | Case qty to split for this PO item.<br>The field is required when the PO is in case qty mode.<br>Should not be provided when the PO is not in case qty mode. | No |
| PoItem.CaseQtyReceivedToSplit | Integer | Case qty received to split for this po item.<br>Should not be provided when the PO is not in case qty mode.<br>It cannot be set when the receiving warehouse for the item is bin-enabled. | No |

### Response

- If the user is authenticated and the request is successful, then the response will be **Status Code 200 => OK** and the NewPoID returned in the response
- If the user is not authenticated, then the response will be **Status Code 401 => Not Valid Token**
- In case of an error, the response will be **Status Code 500 => Internal Server Error**
- In case of an incorrect request, the response will be with status code **400 Bad Request**

### Response Body

```json
{
  "NewPoID": "<po id of the newly created po>"
}
```
