Sales Order Taxes not applied via REST API

I didn’t find any solution throw the API i have written a function to fetch the taxe items but it will help you only if you have your custom frappe app

def _set_sales_taxes_and_charges(sales_order):
    if not sales_order.taxes_and_charges:
        return
    taxes_and_charges_template = frappe.get_doc('Sales Taxes and Charges Template', sales_order.taxes_and_charges)
    # taxes = []
    tax_fields = [
        "charge_type",
        "account_head",
        "description",
        "cost_center",
        "rate",
        "row_id",
        "idx",
        ]    
    for tax in taxes_and_charges_template.taxes:
        sales_order_tax_dict = sales_order.append('taxes', {})
        for field_name in tax_fields:
            sales_order_tax_dict.set(field_name, tax.get(field_name))