POST API for model with has-many models

We have a simple Sales Order table consisting of a header and one or many line items (obviously this could be any model has-many models object). We can fetch an existing sales order with a simple API call such as:

<?xml version="1.0" encoding="UTF-8"?>
    <customer_name>ACME Corporation</customer_name>

The question is, how can we accept and process a POST API request in Yii for a new or existing sales order?