Get order items inside the order
Try below code:
foreach ($orderCollection as $order) {
$items=array();
foreach ($order->getAllItems() as $item) {
$items[] = array(
'id' => $order->getIncrementId(),
'name' => $item->getName(),
'sku' => $item->getSku(),
'Price' => $item->getPrice(),
'Ordered Qty' => $item->getQtyOrdered(),
);
}
$orders['orders'][] = array(
'id' => $order->getIncrementId(),
'store' => 'magento',
'status' => $order->getStatus(),
'name' => $order->getCustomerName(),
'email' => $order->getCustomerEmail(),
'telephone' => $order->getShippingAddress()->getTelephone(),
'street' => $order->getShippingAddress()->getStreet(),
'pincode' => $order->getShippingAddress()->getPostcode(),
'city' => $order->getShippingAddress()->getCity(),
'weight' => $order->getWeight(),
'items' => $items,
);
}