How to Reload DataTable with a New AJAX URL Without Reinitializing?

I have a DataTable implemented on my application and use AJAX to fetch data. Now, I need to dynamically change the AJAX URL and reload the DataTable without reinitializing the entire DataTable. How can I achieve this?

$(document).ready(function() {

    $('#purchase_history').DataTable({
        ajax: {
            url: '/purchase-history',
        },
        columns: [
            { data: 'ref_no', name: 'ref_no' },
            { data: 'location_name', name: 'BS.name' },
            { data: 'name', name: 'contacts.name' },
            { data: 'status', name: 'status' },
            { data: 'payment_status', name: 'payment_status' },
            { data: 'final_total', name: 'final_total' },
            // More columns...
        ]
    });

});

To reload a DataTable with a new Ajax URL without initializing it, first you need to change the Ajax URL then like regular DataTable reload just reload it. Here is an example below:

var history = $('#purchase_history').DataTable();
history.ajax.url( '/purchase-history-new' );
history.ajax.reload();

Change the code as per your need.