'Name Here', // other customer database fields here. see ucm_customer database table. ); $customer_id = $plugins['customer']->save_customer(false, $customer_data); echo "Created customer with ID: $customer_id "; $quote_data = array( 'customer_id' => $customer_id, 'name' => 'Test Quote', // other quote fields here. see ucm_quote database table. ); $save_status = $plugins['quote']->save_quote( false, $quote_data ); $quote_id = !empty( $save_status['quote_id'] ) ? $save_status['quote_id'] : false; if( $quote_id ){ $new_task_data = array('quote_task' => array()); $new_task_data['quote_task'][] = array( 'description' => 'something', 'hours' => 1, 'amount' => 123, ); $new_task_data['quote_task'][] = array( 'description' => 'something', 'hours' => 1, 'amount' => 123, ); $plugins['quote']->->save_quote_tasks($quote_id, $new_task_data); }else{ echo "Failed to create quote"; } // restore logged out state. module_security::user_id_temp_restore();